This idea sems to be fastest what u can do ..as i know.
Then u need to have 2 booleans.
CanItBeLocked: true/false
ActualStatus: locked/unlocked.
So whenever you want to query a node u simply check CanItBeLocked.
But when u actually want to lock/unlock it. then you need to do a
status (CanItBeLo
I think the better idea is that we associate a boolean variable with
each node telling abt lock.
lock instance will be true if
its right child has lock true
its left child has lock true.
* lock true means the node can be locked...
even if the idea does not works for you please tell what yo