Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need Assistance Understanding This Class
Message
De
10/03/2009 10:42:43
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01386808
Message ID:
01386894
Vues:
50
>>>>>>I'm trying to understand a binaray tree class. In the file is this class:
>>>>>>
>>>>>>
>>>>>>// Define tree nodes
>>>>>>public class TTreeNode 
>>>>>>{
>>>>>>   public string name;
>>>>>>   public double value; 
>>>>>>   public TTreeNode left, right;        // <-- What is this??
>>>>>>       
>>>>>>    // Constructor to create a single node 
>>>>>>	public TTreeNode (string name, double d) 
>>>>>>    {
>>>>>>          this.name = name;
>>>>>>          value = d;
>>>>>>          left = null;
>>>>>>          right = null;
>>>>>>    }
>>>>>>}
>>>>>>
>>>>>>
>>>>>>See comment in line. I don't understand that syntax.
>>>>>
>>>>>The TTreeNode class has left and right pointers of the same class.
>>>>
>>>>I have no idea what that means. I don't even know what to Google to read up on it.
>>>
>>>Basically a tree is a node with two branches. The left and the right are the reference to the two branches. Note that this class, the left variable, and the right variable are the same data type.
>>
>>After looking at the code closer I would also like to add a public cringle that they declared the member variables as public and didn't include properties. I think Bonnie beat that into me with a stick.
>
>Smart lady, Bonnie ;-)
>
>Remember me saying a while ago that I found ADO.NET pretty straightforward? Well, scratch that now that I am working on a project in it for class. I have the general concepts but it gets trickier implementing a non-trivial solution. There are so many different options. The instructor who taught the ADO part of the course wasn't the greatest, either, which didn't help. There are several different professors/instructors and this guy was the weak link. Presentations 101 badly needed. He also had one verbal tic that drove me nuts -- "actually" is apparently his favorite word in the English language. "Now we're actually going to run this example...." -- whap! LOL

Ok, so what you need to do here, is to get his phone number and pass it over to Terry McD.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform