Click here to Skip to main content
16,020,249 members
Home / Discussions / C#
   

C#

 
QuestionHow to implement Trees ... Pin
JamesT113-Jul-06 5:38
JamesT113-Jul-06 5:38 
AnswerRe: How to implement Trees ... Pin
Christian Graus13-Jul-06 5:45
protectorChristian Graus13-Jul-06 5:45 
GeneralRe: How to implement Trees ... Pin
Josh Smith13-Jul-06 5:50
Josh Smith13-Jul-06 5:50 
GeneralRe: How to implement Trees ... Pin
Christian Graus13-Jul-06 5:53
protectorChristian Graus13-Jul-06 5:53 
GeneralRe: How to implement Trees ... Pin
Josh Smith13-Jul-06 5:59
Josh Smith13-Jul-06 5:59 
GeneralRe: How to implement Trees ... Pin
led mike13-Jul-06 7:28
led mike13-Jul-06 7:28 
AnswerRe: How to implement Trees ... Pin
Jun Du13-Jul-06 5:51
Jun Du13-Jul-06 5:51 
AnswerRe: How to implement Trees ... [modified] Pin
User 665813-Jul-06 5:53
User 665813-Jul-06 5:53 
class Tree
{
    private int value = 0;

    public Tree leftChild = null;
    public Tree rightChild = null;

    public Tree(int value) { this.value = value; }
}


To populate the tree:

Tree root = new Tree(123);
root.leftChild = new Tree(5);
root.rightChild = new Tree(411);


This is a very basic binary tree, which looks like this:

Tree (123)
|
|
|- leftChild (5)
| |------- leftChild (null)
| |------- rightChild (null)
|
|------- rightChild (411)
| |------- leftChild (null)
| |------- rightChild (null)

There's various sorts of trees, see some examples at wikipedia:

Binary Tree

regards

modified 12-Sep-18 21:01pm.

AnswerRe: How to implement Trees ... Pin
BoneSoft13-Jul-06 6:13
BoneSoft13-Jul-06 6:13 
AnswerCS 101 Pin
Ennis Ray Lynch, Jr.13-Jul-06 6:22
Ennis Ray Lynch, Jr.13-Jul-06 6:22 
AnswerRe: How to implement Trees ... Pin
Eric Dahlvang13-Jul-06 7:54
Eric Dahlvang13-Jul-06 7:54 
QuestionTrying to print an html page without to load it in asp.net Pin
sai_akkina13-Jul-06 5:12
sai_akkina13-Jul-06 5:12 
AnswerRe: Trying to print an html page without to load it in asp.net Pin
Not Active13-Jul-06 5:24
mentorNot Active13-Jul-06 5:24 
AnswerRe: Trying to print an html page without to load it in asp.net Pin
Dave Kreskowiak13-Jul-06 6:38
mveDave Kreskowiak13-Jul-06 6:38 
GeneralRe: Trying to print an html page without to load it in asp.net Pin
sai_akkina13-Jul-06 18:11
sai_akkina13-Jul-06 18:11 
Questionmoving an image Pin
john3413-Jul-06 5:00
john3413-Jul-06 5:00 
AnswerRe: moving an image Pin
Christian Graus13-Jul-06 5:09
protectorChristian Graus13-Jul-06 5:09 
AnswerRe: moving an image Pin
Robert Rohde13-Jul-06 5:17
Robert Rohde13-Jul-06 5:17 
AnswerRe: moving an image Pin
Dave Kreskowiak13-Jul-06 6:51
mveDave Kreskowiak13-Jul-06 6:51 
AnswerRe: moving an image [modified] Pin
Dave Kreskowiak13-Jul-06 10:19
mveDave Kreskowiak13-Jul-06 10:19 
GeneralRe: moving an image Pin
john3413-Jul-06 23:03
john3413-Jul-06 23:03 
QuestionPassing more than one QueryString Pin
leckey13-Jul-06 4:28
leckey13-Jul-06 4:28 
AnswerRe: Passing more than one QueryString Pin
Not Active13-Jul-06 4:55
mentorNot Active13-Jul-06 4:55 
QuestionDoing own ToolStripItems… Pin
anderslundsgard13-Jul-06 4:26
anderslundsgard13-Jul-06 4:26 
AnswerRe: Doing own ToolStripItems… Pin
Ed.Poore15-Jul-06 13:04
Ed.Poore15-Jul-06 13:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.