Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #10378
| From | Martin Gregorie <martin@address-in-sig.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Collection to implement linked structure traverse up and down |
| Date | 2011-11-30 21:17 +0000 |
| Organization | UK Free Software Network |
| Message-ID | <jb66gp$5an$2@localhost.localdomain> (permalink) |
| References | <68dffbe9-ba9e-4daa-9bab-deac913b2cfe@t38g2000prg.googlegroups.com> |
On Sun, 27 Nov 2011 23:53:30 -0800, ruds wrote: > Hi, > I want to implement a tree or a linked structure where I can traverse to > the parent of a node also and the same node refers to another data > related to it too. > for example i have a set [0,1,2,3,...10], consider these as levels, so ) > will be at top i.e the root, 1 will be first level, and so on. each of > these levels will again have some branches and some data needs to be > referenced with this too for comparison with another similar tree of > this kind. Also, once I get the comparion of the branch X done I need to > traverse to its parent level and it higher level. > I think TreeMapClass and LinkedHashMapClass will be helpfull to me in > this regard. > This need not be a tree, it can be a linked list too. > Please tell me am i on the right path? Kindly, suggest the > implementation too. > The main problem is that, unless I missed something, none of the standard Tree* classes implement a getParent() method - if you need that operation you'll probably need to implement a red-black tree or Btree yourself, but once that's done there's no reason why each node shouldn't use some Collection class to hold your data items. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
Collection to implement linked structure traverse up and down ruds <rudranee@gmail.com> - 2011-11-27 23:53 -0800
Re: Collection to implement linked structure traverse up and down Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-11-28 07:32 -0400
Re: Collection to implement linked structure traverse up and down Wayne <nospam@all.invalid> - 2011-12-01 10:39 -0500
Re: Collection to implement linked structure traverse up and down ruds <rudranee@gmail.com> - 2011-12-04 23:57 -0800
Re: Collection to implement linked structure traverse up and down Lew <lewbloch@gmail.com> - 2011-12-05 15:08 -0800
Re: Collection to implement linked structure traverse up and down ruds <rudranee@gmail.com> - 2011-12-05 21:55 -0800
Re: Collection to implement linked structure traverse up and down Roedy Green <see_website@mindprod.com.invalid> - 2011-11-29 17:01 -0800
Re: Collection to implement linked structure traverse up and down Henk van Voorthuijsen <voorth@xs4all.nl> - 2011-12-05 02:41 -0800
Re: Collection to implement linked structure traverse up and down Martin Gregorie <martin@address-in-sig.invalid> - 2011-11-30 21:17 +0000
csiph-web