Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need Assistance Understanding This Class
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01386808
Message ID:
01386853
Vues:
48
>>>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.


Consider the term Binary to mean Two. This refers to the Left and Right properties as links to child nodes. Each child node can then have two more links to additional child nodes.

http://en.wikipedia.org/wiki/Binary_tree

This page describes several types of binary tree representation and usages. But look to the right and top of the page for simple type.
Greg Reichert
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform