[algogeeks] Re: need suggestions

2012-03-28 Thread Don
If you have n processors, start with the n possible ways to select from log2 n items. Assign each processor to find a solution based on the resulting subset of remaining items. Each processor should be able to work fairly independently, and when they are done, they can compare results and find the

Re: [algogeeks] Re: need suggestions

2012-03-28 Thread Arun Vishwanathan
@Don: I am not clear with your explanation. Please can you give me an example? On Wed, Mar 28, 2012 at 6:19 AM, Don dondod...@gmail.com wrote: If you have n processors, start with the n possible ways to select from log2 n items. Assign each processor to find a solution based on the resulting

[algogeeks] Re: need suggestions

2012-03-28 Thread Don
Let's say that you have 16 processors. You are trying to solve the 0-1 knapsack problem for 40 items. Each item i has size S[i], and you need to find the subset of items which sums as close to T as possible without exceeding T. Pick four of items. There are 16 possible combinations of those

Re: [algogeeks] Re: need suggestions

2012-03-28 Thread Arun Vishwanathan
Thanks Don! On Wed, Mar 28, 2012 at 7:09 AM, Don dondod...@gmail.com wrote: Let's say that you have 16 processors. You are trying to solve the 0-1 knapsack problem for 40 items. Each item i has size S[i], and you need to find the subset of items which sums as close to T as possible without

Re: [algogeeks] [URGENNT] : naukri.com paper pattern

2012-03-28 Thread Aman Goyal
10 multiple choice questions on C : very easy , Kanetkar will suffice. Aptitude : subjective , with mostly mathematical puzzles . Lengthy due to time consuming problems. Focus on accuracy .Series completion, Time speed distance,permutation and combination is what i can recall in the aptitude

[algogeeks] Re: MS QUESTION_LINKED LIST

2012-03-28 Thread Algo-Geek
using stack, the problem can be solved in O(n) time. here is the algo :- 1- push first node in stack. mark next node as current 2 - start from current element and check if the node on top of stack is smaller than current , then pop the node and make its next_largest pointer set to current. Do

Re: [algogeeks] Re: MS QUESTION_LINKED LIST

2012-03-28 Thread atul anand
@Algo-Geek : this wont work , as requirement of the problem is different . even i misunderstood the problem and posted the algo above doing the same as you have mentioned , but question doesn't say next larger element on right side. It just ask for next larger element cud be on left or cud be on