Java

Moderators: zibadian
Number of threads: 7818
Number of posts: 18218

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

Report
k-Node tree Posted by suburbanmt on 4 Apr 2006 at 11:32 PM
Hi,

I would like to implement a tree structure with a root node and each node can have k-child nodes. Does anyone know of a datastructure that represents this type of tree apart from a B-Tree.

Thanks
Report
Re: k-Node tree Posted by zibadian on 4 Apr 2006 at 11:59 PM
: Hi,
:
: I would like to implement a tree structure with a root node and each node can have k-child nodes. Does anyone know of a datastructure that represents this type of tree apart from a B-Tree.
:
: Thanks
:
I don't know of a library class, which has that structure, but it can easily be created. All you need is to have each node contain a Collection of other nodes, representing its children.
Report
Re: k-Node tree Posted by suburbanmt on 6 Apr 2006 at 8:59 AM
: : Hi,
: :
: : I would like to implement a tree structure with a root node and each node can have k-child nodes. Does anyone know of a datastructure that represents this type of tree apart from a B-Tree.
: :
: : Thanks
: :
: I don't know of a library class, which has that structure, but it can easily be created. All you need is to have each node contain a Collection of other nodes, representing its children.
:

I have implemented it that way by having each node containing a vector of child nodes - but I don't know whether it is efficient or not. Any idea please?



 

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.