I thnik the statement is : a node cannot be locked of any of its ancestors and descendents are locked. On Tue, Sep 1, 2009 at 8:21 PM, ankur aggarwal<[email protected]> wrote: > @narendra.. > > i think ques need to recheck becoz the statement u r giving "A node cannot > be locked if any of its descendant or ancestor is locked " .. > > should not be > > " A node cannot be locked if any of its " ancestor " is > locked." > > On Sat, Aug 29, 2009 at 11:35 PM, nagendra kumar <[email protected]> > wrote: >> >> Given a n-ary tree of resources arranged hierarchically. A process >> needs to lock a resource node in order to use it. But, >> A node cannot be locked if any of its descendant or ancestor is >> locked. >> I was supposed to >> -> write the structure of node >> -> write codes for >> -> islock()- returns true if a given node is locked and false if it is >> not >> -> lock()- locks the given node if possible and updates lock >> information >> -> unlock()- unlocks the node and updates information. >> Codes should be : >> Islock –O(1) >> Lock()- O(log n) >> unLock()- O(log n) >> >> > > > > >
--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
