[algogeeks] Re: K minimum sums in two sorted arrays ?

2006-12-01 Thread arxor
Hi, Quintopia, Maybe you misunderstood my algorithm above. S_k is a set of ordered pair (i,j) each time we pop the min(S_k) from S_k, we insert at most 2 element in it so its size is in O(k) I think the following should be more clear: heap: MIN_HEAP visited[n][n] =

[algogeeks] Re: K minimum sums in two sorted arrays ?

2006-12-01 Thread arxor
Hi, ljb, Let me have a try to prove the correctness of it. Let define a property A(S) : S is a set of ordered pair (i,j), and every pair (x,y) whose sum(x,y) is less than min{S} = sum(mi,mj) is already output. Initially, we have S_1 = {(1,1)}, A(S_1) holds. Suppose that for n, A(S_n) holds,

[algogeeks] Re: 6 Pick Bet Grouping

2006-12-01 Thread smartdude
Reading about hamming distance and clustering methods might help. bullockbefriending bard wrote: A single 6 Pick bet looks like this: RACE1 RACE2RACE3RACE4 RACE5 RACE6 runner1 / runner 2 / runner 3 / runner4 / runner5 / runner6 - $amount e.g. we might have: 5 / 3 / 11 / 7

[algogeeks] Re: dynamic programming

2006-12-01 Thread Robby
I have the same question. It seems the S-G function doesn't work when there is a draw... ? Rajiv Mathews 写道: Is there a way to leverage this solution to handle more than one pile of matches? Say there were k piles each containing n_1, n_2, ..., n_k matches, with the same rules, that is

[algogeeks] Ebook

2006-12-01 Thread mohamad momenian
Hi can any one help me to find this ebook free ( please help me ) thank you : Horowitz, Sahni, Mehta: Fundamentals of Data Structures in C++ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Algorithm Geeks

[algogeeks] Re: Problem 4.2 from Introduction to algorithms

2006-12-01 Thread W Karas
wrb wrote: in arrange 1..n there are n different numbers. how can you fill A[1..n] without any one of them? That occurred to me as well, but I assumed that it must be allowed that for A[i] == A[j], i != j because otherwise it would be impossible for there to be any missing numbers.

[algogeeks] Re: K minimum sums in two sorted arrays ?

2006-12-01 Thread Quintopia
you're right. I didn't understand it. your solution is correct. My version would only work in cases in which we didn't need to print the same minimum sum as many times as it appears. . .but it wouldn't even be very good at this. In other words, I solved a completely different problem, yes?

[algogeeks] Re: 6 Pick Bet Grouping

2006-12-01 Thread Quintopia
I think this one might have some optimal substructure, though it's not exactly clear what that may be. I'll give it some thought. On Dec 1, 6:26 am, smartdude [EMAIL PROTECTED] wrote: Reading about hamming distance and clustering methods might help. bullockbefriending bard wrote: A single

[algogeeks] Re: 6 Pick Bet Grouping

2006-12-01 Thread bullockbefriending bard
Thanks. I'm going to try to see what happens if I throw my data at py-cluster with some kind of nearness metric based initially upon Hamming distance - perhaps later can include bet size in this and kill two birds with one stone. Still going to be a lot of computational work to then group

[algogeeks] Re: 6 Pick Bet Grouping

2006-12-01 Thread bullockbefriending bard
Any pointers much appreciated - I simply don't have the background or experience to be able to visualise what this might be. I take it as a given that the problem is NP-hard at the very least and that there is no alternative but to go at it with some kind of greedy heuristic - and any way of

[algogeeks] Amplification

2006-12-01 Thread bullockbefriending bard
I'm going to want to be able to recognise and merge the likes of: 5 + 7 / 3 / 11 / 7 + 14 / 1 / 9 - $50 ($200 total) 5 + 7 / 3 / 11 / 7 + 14 / 1 / 2 - $50 (ditto) into 5 + 7 / 3 / 11 / 7 + 14 / 1 / 2 + 9 $50 ($400 total) And so on, 'recursively' so that in a perfect world I'd end up with each

[algogeeks] 6 Pick Bet Grouping

2006-12-01 Thread bullockbefriending bard
Oops... I think I just did a silly thing and changed title of entire thread due to unfamiliarity with Google Groups. Anyway, changing subject back to '6 Pick Bet Grouping' just in case. --~--~-~--~~~---~--~~ You received this message because you are subscribed