Thanks I got the solution. Sorry for repeat..:)
If anyone is interested in the solution, please read the above
carefully !!! :)

Regards
Sundi





On Jan 12, 12:33 pm, Sundi <sundi...@gmail.com> wrote:
> Hi
> Write a procedure for LOCK(pointer to x) in  a N-ary Tree , satisfying
> the following:
>
> 1. n>x(x is a descendant of n) and n is locked, then LOCK(x) should
> return false else true.
> 2. n<y(n is a descendant of y) and n is locked, then LOCK(y) should
> return false else true.
>
> Similarly for UNLOCK,
>
> one solution is:
> to traverse through the subtree of the pointer to which lock is to be
> applied to chk condition 2, but is there any solution better then
> (O(n)), check 1 can be easily tracked by using parent pointer

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to