[algogeeks] Re: N-Ary Tree and Resource management

2009-08-29 Thread priya k
// Data Structure for the n-ary tree struct node { int data; node * child[m]; bool lockFlag; // Indicates if a node is locked or not node *parent; //Holds the immediate parent of the node int LockCount; //Holds how many nodes arrested this node }; // Takes logm(N) in the worst

[algogeeks] Re: Room Permutation Algorithm

2009-07-06 Thread priya k
Hi Pete, I think you are not permuting the elements. But rather you are looking for combinations with repetition for a set of elements. The number of such combinations would be n+r-1Cr where n is the number of the elements and r is the number of elements we have to choose. So a combinatorial

[algogeeks] Algo Question

2009-07-01 Thread priya k
we have many machines connected to each other. However, administering these machines is a great hassle. That is because a machine can be administered only by a machine connected directly to it (a machine that is an administrator can administrator itself). So, the system administrators have