C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2720
Number of posts: 5746

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
C# binary tree Posted by guy sela on 14 Jun 2002 at 1:41 AM
Hi
i'm new to c# and would like to know how do i write a simple app
that will sort using binary tree a list with first & last name.
When i add a new name it will sort them
thanx
guy
Report
Re: C# binary tree Posted by STiAT on 18 Jun 2002 at 8:56 AM
This message was edited by the STiAT at 2002-6-18 9:3:4

This message was edited by the STiAT at 2002-6-18 8:56:44

: Hi
: i'm new to c# and would like to know how do i write a simple app
: that will sort using binary tree a list with first & last name.
: When i add a new name it will sort them
: thanx
: guy
:

Use classes like in C++. It's simple, you have a class for the tree, and one for the list of elements of the tree, and one for the elements of the list

class list_element
{
private string fname, lname;
private list_element next, back;

//public ...

}

class tree_element
{
private list_element head;
private tree_element left, right;
//public ...
}

class btree
{
private tree_element root;
//public all access functions...
}




Report
Re: C# binary tree Posted by guy sela on 20 Jun 2002 at 3:21 AM
: This message was edited by the STiAT at 2002-6-18 9:3:4

: This message was edited by the STiAT at 2002-6-18 8:56:44

: : Hi
: : i'm new to c# and would like to know how do i write a simple app
: : that will sort using binary tree a list with first & last name.
: : When i add a new name it will sort them
: : thanx
: : guy
: :
:
: Use classes like in C++. It's simple, you have a class for the tree, and one for the list of elements of the tree, and one for the elements of the list
:
: class list_element
: {
: private string fname, lname;
: private list_element next, back;
:
: //public ...
:
: }
:
: class tree_element
: {
: private list_element head;
: private tree_element left, right;
: //public ...
: }
:
: class btree
: {
: private tree_element root;
: //public all access functions...
: }
:
:
:
:
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.