Appropriate Data Structure for a TreeView?

BlitzMax Forums/BlitzMax Programming/Appropriate Data Structure for a TreeView?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

That indeed would be a potential way as well. Doing the "dictionary way". Each treeview node is a typeinstance. This typeh as a "childs" list which uses TMap ...
But this depends on the amount of childs there normally are. if log2(childs) isn't significantly smaller than childs (number of childs) then it doesn't make that much sense to use a TMap.

but if you have 10+ childs on each treeview node it will start to make a significant difference when jumping down the tree.


Another way is just 1 TMap ... and put all nodes in there with their node text as key.
Thats very fast as well.


don't know if the "encoding" would make it faster than one of the above solutions as decoding needs time as well