Re: [algogeeks] Re: Array Ranking Problem

2010-12-24 Thread Terence
My method is using DP, as Snehal have pointed out. Suppose S[0..n-1] and T[0..n-1] denotes the score and time for the n questions respectively. C[k][s] denotes the maximum total time when choosing from the first k questions such that the total score do not exceed s. Then C[0][s] = 0 C[k][

Re: [algogeeks] Re: Array Ranking Problem

2010-12-23 Thread Ankur Khurana
how will you choose that ?? without sorting . can you please mention what method you intend to use to achieve that purpose ? On Fri, Dec 24, 2010 at 8:16 AM, Terence wrote: > @Ankur: > It is just 0/1 knapsack problem: >    Choose a subset of the questions with sum of scores not exceeding (Total >

Re: [algogeeks] Re: Array Ranking Problem

2010-12-23 Thread Terence
@Ankur: It is just 0/1 knapsack problem: Choose a subset of the questions with sum of scores not exceeding (Total Score - Pass Score), while maximize the sum of time of the subset. So I do not think O(nlogn) greedy algorithm will solve this problem. On 2010-12-23 23:38, Ankur Khurana wrote:

Re: [algogeeks] Re: Array Ranking Problem

2010-12-23 Thread Nikhil Agarwal
@Ankur Now its clear.:) On Thu, Dec 23, 2010 at 10:25 PM, Ankur Khurana wrote: > i will try to elaborate or rewrite tat part > > On Thu, Dec 23, 2010 at 10:25 PM, Ankur Khurana > wrote: > > wverything i mentioned above can be done in O(n) but sorting part is > > nlogn . so that is what i was say

Re: [algogeeks] Re: Array Ranking Problem

2010-12-23 Thread Ankur Khurana
i will try to elaborate or rewrite tat part On Thu, Dec 23, 2010 at 10:25 PM, Ankur Khurana wrote: > wverything i mentioned above can be done in O(n) but sorting part is > nlogn . so that is what i was saying. can you specify where i was not > clear ? > > On Thu, Dec 23, 2010 at 9:22 PM, Nikhil A

Re: [algogeeks] Re: Array Ranking Problem

2010-12-23 Thread Ankur Khurana
wverything i mentioned above can be done in O(n) but sorting part is nlogn . so that is what i was saying. can you specify where i was not clear ? On Thu, Dec 23, 2010 at 9:22 PM, Nikhil Agarwal wrote: > @ankur can you hint your nlogn solution? > > On Thu, Dec 23, 2010 at 9:08 PM, Ankur Khurana

Re: [algogeeks] Re: Array Ranking Problem

2010-12-23 Thread Nikhil Agarwal
@ankur can you hint your nlogn solution? On Thu, Dec 23, 2010 at 9:08 PM, Ankur Khurana wrote: > it is just like 0/1 knapsack problem with maximum weight of knapsack > as 40. but in this case that is minimum that we have to calculate. > calculate marks/time for every element . then try finding th

Re: [algogeeks] Re: Array Ranking Problem

2010-12-23 Thread Ankur Khurana
it is just like 0/1 knapsack problem with maximum weight of knapsack as 40. but in this case that is minimum that we have to calculate. calculate marks/time for every element . then try finding the elements with max value/time to fulfill the quota of marks. i dont know if this can be done in O(n) b

[algogeeks] Re: Array Ranking Problem

2010-12-23 Thread Davin
Thanks for reply. I am looking for O(n) for solution. Davin On Dec 23, 8:29 pm, snehal jain wrote: > hint : use dp > > > > > > > > On Thu, Dec 23, 2010 at 8:30 PM, Davin wrote: > > Marks for Questions(1,6): {10,15,20,25,10,20} > > Time for Each Questions(1,6) : { 2, 4,3,4, 2,4} > > Passing Mark

Re: [algogeeks] Re: Array Ranking Problem

2010-12-23 Thread snehal jain
hint : use dp On Thu, Dec 23, 2010 at 8:30 PM, Davin wrote: > Marks for Questions(1,6): {10,15,20,25,10,20} > Time for Each Questions(1,6) : { 2, 4,3,4, 2,4} > Passing Marks : 40 Out of 100 > > Find Questions with minimum time to pass the exam? > > On Dec 23, 7:04 pm, juver++ wrote: > > Please

[algogeeks] Re: Array Ranking Problem

2010-12-23 Thread Davin
Marks for Questions(1,6): {10,15,20,25,10,20} Time for Each Questions(1,6) : { 2, 4,3,4, 2,4} Passing Marks : 40 Out of 100 Find Questions with minimum time to pass the exam? On Dec 23, 7:04 pm, juver++ wrote: > Please clarify the problem statement. Provide example. > From the first view problem

[algogeeks] Re: Array Ranking Problem

2010-12-23 Thread juver++
Please clarify the problem statement. Provide example. >From the first view problem seems to be unclear. -- 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