Docs » Autodocs » exec.library » AVL_FindPrevNodeByAddress
AVL_FindPrevNodeByAddress -- Return previous node of a tree (V45)
result = AVL_FindPrevNodeByAddress( node ) D0 A0 struct AVLNode *AVL_FindPrevNodeByAddress(const struct AVLNode *node)
Given the pointer to a struct AVLNode, this function will return the logically previous/lower/smaller entry in the tree Using this function, you can start to walk the tree in a "linear" fashion.
node - pointer to the current AVLNode
A pointer to the logically previous AVLNode or NULL if there is none.
The node passed in *better*be* part of the tree or you lose big time!
avlnode = AVL_FindLastNode(avlroot); while(avlnode) { prevavlnode = AVL_FindPrevNodeByAddress(avlnode); /* look at, or remove avlnode */ /* walk the tree */ avlnode = prevavlnode; } /* while */
AVL_FindLastNode(), AVL_RemNodeByAddress()
|