This can be solved by Dynamic Programming.
Let the denominations be d1,d2,...,dn and their corresponding numbers
be P1,P2,...,Pn. Let C(n,S) be the matrix which tells us if the amount
S can be obtained by using coins d1,...,dn.
Then C(n,S) = C(n-1,S) if denomination dn is not used, else
C(n,S) = C
I have encountered a problem in my current project that seems pretty
much related to the subset sum problem. I just want to make sure it is
not a special case of the subset sum problem and whether it has a
efficient solution or not.
We are doing an application for tellers in a bank. The teller bas
This method does not have any stopping conditions it will loop foreverOn 1/2/06, leeight xjtu <[EMAIL PROTECTED]
> wrote:function abc(int i){
return abc((i % 2 == 1) ? i * 3 + 1 : i / 2);}
can you tell me WHY the result returnĀ by the function abc is always 1, no matter what is i?2006/1/2, Peyman
function abc(int i){
return abc((i % 2 == 1) ? i * 3 + 1 : i / 2);}
can you tell me WHY the result returnĀ by the function abc is always 1, no matter what is i?2006/1/2, Peyman <
[EMAIL PROTECTED]>:Hi Saravana,
Why don't you try to find Prime numbers? Recently, some indian guy,showed that Prime is
On 1/2/06, Michael Ageeb <[EMAIL PROTECTED]> wrote:
> Yes but this will consume O(n) time at the start of the algorithm as a
> pre-calculations
well, I probably didn't understand the initial problem,
awfully sorry ! :)
I thought that the calculation of the sum must be done
in O(log n) or less, bu
Hi Saravana,
Why don't you try to find Prime numbers? Recently, some indian guy,
showed that Prime is not NP anymore, but still, there's quite a lot
effort to find a new prime numbers that are huge! And it's useful in
encryption.
-- Forwarded message --From:
[EMAIL PROTECTED] <[EMAIL PROTECTED]
>Date: Jan 2, 2006 8:51 PMSubject: LOAPS: Programmer Of The Month reminderTo: [EMAIL PROTECTED]
Happy New Year friends - I'm hoping one of your resolutions is to
write a program for the Programmer Of The Month con
Yes but this will consume O(n) time at the start of the algorithm as a
pre-calculations
On 1/2/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> wont it take O(n^2) memory
the partial sum of any "distance" would take O(n^2) memory,
the partial sum from the first element to any element of the array
takes O(n) memory.
If you want the sum from the i-th to the j-th element, just
comput
wont it take O(n^2) memory
just read these array is O(n)
then precompute the partial-sum O(n)
sum from (i,j) takes O(1) time
Given sorted array of size n. For any i, j < n; return me sum from
array[i] to array[j] in O(log n). You can use O(n) memory, do
pre-computations and store it in a data structure
-Abhishikt
Hi Varadha,
Could you present your logic please?
13 matches
Mail list logo