0

I have a TreeView. I would not know how many children the tree would have. I want to traverse the treeview in reverse order. I need to process all the leaves first, and then if my processing does not satisfy, it should process the parents of all the leaves. And then its parents, so on until the root element.

Is there a way to do this? Please help. TIA.

NaveenBharadwaj
  • 1,212
  • 5
  • 19
  • 42
  • I think you will get more assistance, if you clear JavaFX specific part of your question and provide TreeView pseudo data structure, and add "algorithm" "tree-traversal" "data-structure" etc tags. – Uluk Biy Aug 05 '15 at 09:09
  • And If you do that, in that case, it is better to post your question in other community sites of StackExchange like http://math.stackexchange.com/, http://cs.stackexchange.com/, http://datascience.stackexchange.com/ etc. – Uluk Biy Aug 05 '15 at 09:15
  • You may be interested in this related question: [TreeView - How to count all children (including collapsed)](http://stackoverflow.com/questions/26795514/treeview-how-to-count-all-children-including-collapsed), but I'm guessing that is slightly different from what you want, and you actually want to apply this algorithm: [Reverse Level Order Traversal](http://algorithms.tutorialhorizon.com/reverse-level-order-traversal/) – jewelsea Aug 12 '15 at 10:49
  • Thanks guys. I cracked it myself – NaveenBharadwaj Aug 12 '15 at 11:35

0 Answers0