I wrote tree functions, it works very well BUT it only work for ONE type which sounds too bad for me so i think it may be a good idea to have new "NewThing"s in PB...
- NewTree
A tree would be like a linked list, with a current node, changing position to the superior (if it's not the root) or the siblings or the children. A tree could have "several roots" (several siblings whit no superior) like in the tree gadget. - NewBinaryTree
A binary tree would have a current node but also a position for each node. The position would be a string of zeros and ones ("001101001text11111" would be the "001101001" position) and an empty string would change the current node to the root. - NewBST (Binary Search Tree)
A BST would only work with ordonned types (integers, floats and maybe strings because of the "<" and ">" operators) and positions would be choosen automatically to ensure the tree to always be sorted (and it wouldn't be possible to have two nodes with the same value)
I can make my functions work for any type, i did it when i tried to make my own pb-like linked lists but it wouldn't be the same as doing somthing like :
myvariable = mytree() ;get the current node's value
SuperiorNode( mytree() ) ;go to the superior node
debug mytree() ;display the node's value
I know it's a "not really small" request but i also know it would be a great feature.
Dri