Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

C# binary tree

guy selaguy sela Posts: 2Member
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

Comments

  • STiATSTiAT Posts: 4Member
    [b][red]This message was edited by the STiAT at 2002-6-18 9:3:4[/red][/b][hr]
    [b][red]This message was edited by the STiAT at 2002-6-18 8:56:44[/red][/b][hr]
    : 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...
    }




  • guy selaguy sela Posts: 2Member
    : [b][red]This message was edited by the STiAT at 2002-6-18 9:3:4[/red][/b][hr]
    : [b][red]This message was edited by the STiAT at 2002-6-18 8:56:44[/red][/b][hr]
    : : 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...
    : }
    :
    :
    :
    :
    :

Sign In or Register to comment.