Given an array of length N. How will you find the minimum length
contiguous sub - array of whose sum is S and whose product is P . Here
S and P will be given to you.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send
Does array consists of negative nos?
On Tue, Oct 19, 2010 at 1:28 PM, Abhishek Kumar Singh
iiita2007...@gmail.com wrote:
Given an array of length N. How will you find the minimum length
contiguous sub - array of whose sum is S and whose product is P . Here
S and P will be given to you.
--
hello Friend:
I have good news for you. Last week
I have Order china 18 Products Samsung UN55B8000 55-Inch 1080p 240Hz LED HDTV
w e b: moaoeso.com I have received the product!
It's amazing! The item is original, brand new and has high quality,
but it's muc cheaper. I'm pleased to share this good
You can order the envelopes by area!
Wladimir Araujo Tavares
http://www.si.ufc.br/~wladimir http://www.si.ufc.br/%7Ewladimir/
Fiz uma faculdade! Só não fiz a segunda porque acabaram os tijolos.
On Tue, Oct 19, 2010 at 11:23 AM, Wladimir Tavares wladimir...@gmail.comwrote:
This problem is a
This problem is a variation of Longest Increasing Subsequence (LIS). The
faster algorithm é O(n log n)
http://en.wikipedia.org/wiki/Longest_increasing_subsequence
http://www.algorithmist.com/index.php/Longest_Increasing_Subsequence
Wladimir Araujo Tavares
http://www.si.ufc.br/~wladimir
Lets say A is the array of length N.
Create an array sum of length N and initialize it to 0.
Create an array product of length N and initialize it to 1.
for ( i=0 to i=N-1 )
{
for ( j = i to j = 0 ) {
sum[j] = sum[j] + A[ i]
product[j]= product[j] * A [i]
}
for( k=0 to k= i )
if ( sum[k] == S
*Dear Partner,
Hope you are doing well!*
*Please send resumes to* *a...@panzersolutions.com*a...@panzersolutions.com
*Job Title : SAP OM/PA Consultant
Location : OH
Duration : 6 months Contract*
*Rate : $65/Hr on C2C Max.*
*Key skills required:
@ Rahul patil ofcourse array may have negative or positive integers
@ Kishen both O(n) and O(n logn) solutions was asked in this yahoo coding
round question
On Tue, Oct 19, 2010 at 1:28 PM, Abhishek Kumar Singh
iiita2007...@gmail.com wrote:
Given an array of length N. How will you find the
hello friends.
plz suggest some new ideas for java projects for IT 4th year
--
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 group, send
In the below code the jth and kth inner for loops can be run in parallel
making them O(1) and the entire thing O(n).
for ( i=0 to i=N-1 )
{
for ( j = i to j = 0 ) {
sum[j] += A[ i]
product[j] *= A [ i]
}
for( k=0 to k= i )
if ( sum[k] == S and product[k] == P ) {
Answer is the sub array A[k to
o(n) soln
Lets say A is the array of length N.
Create an array sum of length N and initialize it to 0.
Create an array product of length N and initialize it to 1.
now sum[i]=sum[i-1]+A[i]; sum[0]=A[0];
product[i]=product[i-1]+A[I]product[0]=A[0];
make a two hash table for
You are in wrong group.
On Wed, Oct 20, 2010 at 4:20 AM, Ayush Mittal ayushmittal2...@gmail.comwrote:
hello friends.
plz suggest some new ideas for java projects for IT 4th year
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
Why u people r going for implementing Queue using Stacks??
As Rahul Suggested in second thread can't this problem be solved by
Priority Queue that uses Min Heap functions It clearly takes O(1)
time for extracting minimum element..
--
Thanks Regards
Saurabh Koar
Final Year Under Graduate
13 matches
Mail list logo