We have to implement a "lock(node)" in a binary tree. "lock(node)" returns true if the node is locked and returns false if the given node cannot be locked. The lock on the node can be obtained only when the following conditions are satisfied.
1. A node can be locked only when none of its descendents are locked. 2. A node can be locked only when none of the nodes in the path from root to that node are locked (including root and that node). Implement the "lock(node)" with minimum complexity. Each node contains a parent pointer, pointer to left subtree, pointer to right subtree. (We can have extra memory at each node.) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---
