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
@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
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
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
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
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
@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