Re: [algogeeks] Interesting Question SPOJ

2012-08-16 Thread Sairam Ravu
#include 
#include 
#include 

using namespace std;

int main()
{
 int testcases;
 cin >> testcases;

 int Inputsize[20];
 int  *Output[testcases];

 int i;

for(i=0;i> inputsize;



Order = (int *)malloc(sizeof(int)*(inputsize+1));

   int j;
int value;
for(j=0;j> value;
 Inputsize[j] = value;
 Order[j] =  j+1;
}
Order[j] = '\0';

int temp;
int tempOrder;
int tempIndex;


for(j=0;j MapOrder;
map::iterator  iter;

for(j=0;jsecond;

Output[i] = Order;

 }

 //Now print the output

int j;
 for(i=0;ihttp://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Amazon Online Test

2012-08-16 Thread nick
Hi All,

Has anyone appeared for the online test of amazon recently??
 if(yes){
 Please share with us :)
 }
 

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/xuD9M8vmV74J.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Hii

2012-08-16 Thread Don
If this was possible, most every crypto system in the world would be
useless.
Don

On Aug 14, 4:56 pm, ragavenderan venkatesan 
wrote:
> Given Xor of 3 numbers, How can we derive back those 3 numbers?
> Can any one explain with an example?
>
> Thanks
> Ragavenderan

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Hanoi problem

2012-08-16 Thread Don
Think of how you would describe the problem in English.
The general problem is to move N disks from peg A to peg B using peg C
for extra storage.
If N is 1, you just move the one disk.
Otherwise, you move N-1 disks from A to C, then move the one bottom
disk from A to B, and finally move the N-1 disks from C to B.
In C++ it looks like this:

void hanoi(int From, int To, int Using, int N)
{
   if (N > 1)
   {
  hanoi(From, Using, To, N-1);
  hanoi(From, To, Using, 1);
  hanoi(Using, To, From, N-1);
   }
   else printf("Move disk from %d to %d\n", From, To);
}

Don

On Aug 12, 2:57 pm, Siddharth Malhotra  wrote:
> Please help me out with Hanoi problem of n disks.
> Algorithm and code preferably in C++.
>
> http://en.wikipedia.org/wiki/Tower_of_Hanoi

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: AMAZON: given col id, print col name in excel

2012-08-16 Thread shady
you can do it easily by counting the number that can be formed with 1 digit
= 26, then 2 digit = 26*26... similarly find the length of the answer and
then can find the number by searching using bsearch over the number of
different characters.

if someone can do it with base % method,, then it is great :-P


On Thu, Aug 16, 2012 at 11:19 PM, Wei.QI  wrote:

> @yq, didn't I ask you this question before?
>
> On Fri, Aug 10, 2012 at 4:48 PM, yq Zhang  wrote:
> > @shiv, your code is correct go compute the base 26 number. However, this
> > question is not base 26 number obviously.
> >
> >
> >
> > On Wed, Aug 8, 2012 at 4:46 AM, shiv narayan 
> > wrote:
> >>
> >> this is similar to conversion of no in base 26.( where digits are
> >> a,b,c,d...z) just think it like decimal to binary conversion here base
> is
> >> instead 26.
> >>
> >> char Carr[26]={a,b,c...z}
> >> i=0;
> >> int arr[];
> >> do
> >> {
> >> arrr[i++]=n%26;
> >> n/=2;
> >> }
> >> while(n) ;
> >> for(int i=n-1;i>=0;i--)
> >> cout< >>
> >> correct me if i am wrong.
> >> On Wednesday, 8 August 2012 12:56:56 UTC+5:30, ashgoel wrote:
> >>>
> >>> Imagine a sequence like this: a, b, c...z, aa, ab, ac...zz, aaa, aab,
> >>> aac aax, aaz, aba, abc... (Its same as excel column names). Given
> an
> >>> integer (n), generate n-th string from the above sequence.
> >>>
> >>>
> >>> Best Regards
> >>> Ashish Goel
> >>> "Think positive and find fuel in failure"
> >>> +919985813081
> >>> +919966006652
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Algorithm Geeks" group.
> >> To view this discussion on the web visit
> >> https://groups.google.com/d/msg/algogeeks/-/Z3kYiTZi_F8J.
> >>
> >> To post to this group, send email to algogeeks@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> algogeeks+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> >> http://groups.google.com/group/algogeeks?hl=en.
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from this group, send email to
> > algogeeks+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/algogeeks?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: AMAZON: given col id, print col name in excel

2012-08-16 Thread Wei.QI
@yq, didn't I ask you this question before?

On Fri, Aug 10, 2012 at 4:48 PM, yq Zhang  wrote:
> @shiv, your code is correct go compute the base 26 number. However, this
> question is not base 26 number obviously.
>
>
>
> On Wed, Aug 8, 2012 at 4:46 AM, shiv narayan 
> wrote:
>>
>> this is similar to conversion of no in base 26.( where digits are
>> a,b,c,d...z) just think it like decimal to binary conversion here base is
>> instead 26.
>>
>> char Carr[26]={a,b,c...z}
>> i=0;
>> int arr[];
>> do
>> {
>> arrr[i++]=n%26;
>> n/=2;
>> }
>> while(n) ;
>> for(int i=n-1;i>=0;i--)
>> cout<>
>> correct me if i am wrong.
>> On Wednesday, 8 August 2012 12:56:56 UTC+5:30, ashgoel wrote:
>>>
>>> Imagine a sequence like this: a, b, c...z, aa, ab, ac...zz, aaa, aab,
>>> aac aax, aaz, aba, abc... (Its same as excel column names). Given an
>>> integer (n), generate n-th string from the above sequence.
>>>
>>>
>>> Best Regards
>>> Ashish Goel
>>> "Think positive and find fuel in failure"
>>> +919985813081
>>> +919966006652
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/algogeeks/-/Z3kYiTZi_F8J.
>>
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] MICROSOFT QUESTION

2012-08-16 Thread Dave
@Shady: You can do it with just the input array and the output array. In 
the language of Atul007, put temp2 in the output array, and calculate temp1 
as a scalar, i.e., one element at a time as you replace the elements of 
temp2 with the result.
 
Dave

On Thursday, August 16, 2012 5:40:23 AM UTC-5, shady wrote:

> for n elements, space used - 2n
> can we do better ?
>
> On Thu, Aug 16, 2012 at 3:20 PM, atul anand 
> > wrote:
>
>> input :   23   45
>> temp1 : 26   24   120
>> temp2 : 120  60  20   5
>>
>> for given input ..take tow temp array.
>> temp1[i] = input[0] * input[1] * input[2] * input[3]..input[i]
>> temp2[i] = input[i] * input [i + 1] * input[i + 2]input[n];
>>
>> now out[i] = temp1[i-1] * temp2[i+1];
>>
>>
>> On Thu, Aug 16, 2012 at 2:26 PM, Hariraman R 
>> > wrote:
>>
>>>
>>> Hi,
>>>
>>>This is a microsoft question asked in our campus previous year. 
>>> Anyone having idea please share it here...
>>>
>>>
>>>Given an array of n elements A[n]. Write a program to create a new 
>>> array OUT[n], 
>>>
>>> which has its elements as multiplication of all the elements in the 
>>> input array A[n] except that element (i.e.) OUT[2] = A[0] * A[1] * A[3] * ? 
>>> * A[n-1]. 
>>>  Constraint is one should not use division operator.
>>>
>>>  -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Algorithm Geeks" group.
>>> To post to this group, send email to algo...@googlegroups.com
>>> .
>>> To unsubscribe from this group, send email to 
>>> algogeeks+...@googlegroups.com .
>>> For more options, visit this group at 
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Algorithm Geeks" group.
>> To post to this group, send email to algo...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> algogeeks+...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/u9VqcQM6sz0J.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MICROSOFT QUESTION

2012-08-16 Thread Dave
@Navin: Why? No division is used.
 
Dave

On Thursday, August 16, 2012 9:20:03 AM UTC-5, Navin Kumar wrote:

> We have to consider cases when an element is zero. 
>
> On Thu, Aug 16, 2012 at 7:07 PM, shady >wrote:
>
>> well we can do with just one array. Overwrite the answer directly on 
>> left[] array.
>>
>>
>> On Thu, Aug 16, 2012 at 6:47 PM, mohit 
>> > wrote:
>>
>>>
>>> here are the steps :
>>> 1) Construct a temporary array left[] such that left[i] contains product 
>>> of all elements on left of A[i] excluding A[i].
>>> 2) Construct another temporary array right[] such that right[i] contains 
>>> product of all elements on on right of A[i] excluding A[i].
>>> 3) To get OUT[], multiply left[] and right[]. 
>>>
>>> time complexity : O(n)
>>>
>>>
>>> On Thursday, August 16, 2012 2:26:58 PM UTC+5:30, ram wrote:


 Hi,

This is a microsoft question asked in our campus previous year. 
 Anyone having idea please share it here...

Given an array of n elements A[n]. Write a program to create a new 
 array OUT[n], 



 which has its elements as multiplication of all the elements in 
 the input array A[n] except that element (i.e.) OUT[2] = A[0] * A[1] * 
 A[3] * ? * A[n-1]. 
  Constraint is one should not use division operator.

  -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Algorithm Geeks" group.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msg/algogeeks/-/iqyLUMLQRS0J.
>>>
>>> To post to this group, send email to algo...@googlegroups.com
>>> .
>>> To unsubscribe from this group, send email to 
>>> algogeeks+...@googlegroups.com .
>>> For more options, visit this group at 
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Algorithm Geeks" group.
>> To post to this group, send email to algo...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> algogeeks+...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/cOrXdXwNPUQJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Interesting Question SPOJ

2012-08-16 Thread shady
One nice question, many of you might have solved it... but still worth
sharing
   Link 

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MICROSOFT QUESTION

2012-08-16 Thread Navin Kumar
We have to consider cases when an element is zero.

On Thu, Aug 16, 2012 at 7:07 PM, shady  wrote:

> well we can do with just one array. Overwrite the answer directly on
> left[] array.
>
>
> On Thu, Aug 16, 2012 at 6:47 PM, mohit  wrote:
>
>>
>> here are the steps :
>> 1) Construct a temporary array left[] such that left[i] contains product
>> of all elements on left of A[i] excluding A[i].
>> 2) Construct another temporary array right[] such that right[i] contains
>> product of all elements on on right of A[i] excluding A[i].
>> 3) To get OUT[], multiply left[] and right[].
>>
>> time complexity : O(n)
>>
>>
>> On Thursday, August 16, 2012 2:26:58 PM UTC+5:30, ram wrote:
>>>
>>>
>>> Hi,
>>>
>>>This is a microsoft question asked in our campus previous year. 
>>> Anyone having idea please share it here...
>>>
>>>Given an array of n elements A[n]. Write a program to create a new 
>>> array OUT[n],
>>>
>>>
>>> which has its elements as multiplication of all the elements in the 
>>> input array A[n] except that element (i.e.) OUT[2] = A[0] * A[1] * A[3] * ? 
>>> * A[n-1].
>>>  Constraint is one should not use division operator.
>>>
>>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/algogeeks/-/iqyLUMLQRS0J.
>>
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: MICROSOFT QUESTION

2012-08-16 Thread mohit
yeah we can do it without using an extra array too. first calculating the 
product of elements on its left and putting in OUT[] and then multiplying 
with the product of elements on its right . no auxiliary space used.


On Thursday, August 16, 2012 2:26:58 PM UTC+5:30, ram wrote:
>
>
> Hi,
>
>This is a microsoft question asked in our campus previous year. Anyone 
> having idea please share it here...
>
>Given an array of n elements A[n]. Write a program to create a new 
> array OUT[n], 
>
> which has its elements as multiplication of all the elements in the 
> input array A[n] except that element (i.e.) OUT[2] = A[0] * A[1] * A[3] * ? * 
> A[n-1]. 
>  Constraint is one should not use division operator.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/qFD7wSqIm-QJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MICROSOFT QUESTION

2012-08-16 Thread shady
well we can do with just one array. Overwrite the answer directly on left[]
array.

On Thu, Aug 16, 2012 at 6:47 PM, mohit  wrote:

>
> here are the steps :
> 1) Construct a temporary array left[] such that left[i] contains product
> of all elements on left of A[i] excluding A[i].
> 2) Construct another temporary array right[] such that right[i] contains
> product of all elements on on right of A[i] excluding A[i].
> 3) To get OUT[], multiply left[] and right[].
>
> time complexity : O(n)
>
>
> On Thursday, August 16, 2012 2:26:58 PM UTC+5:30, ram wrote:
>>
>>
>> Hi,
>>
>>This is a microsoft question asked in our campus previous year. 
>> Anyone having idea please share it here...
>>
>>Given an array of n elements A[n]. Write a program to create a new 
>> array OUT[n],
>>
>> which has its elements as multiplication of all the elements in the 
>> input array A[n] except that element (i.e.) OUT[2] = A[0] * A[1] * A[3] * ? 
>> * A[n-1].
>>  Constraint is one should not use division operator.
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/algogeeks/-/iqyLUMLQRS0J.
>
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: MICROSOFT QUESTION

2012-08-16 Thread mohit

here are the steps :
1) Construct a temporary array left[] such that left[i] contains product of 
all elements on left of A[i] excluding A[i].
2) Construct another temporary array right[] such that right[i] contains 
product of all elements on on right of A[i] excluding A[i].
3) To get OUT[], multiply left[] and right[]. 

time complexity : O(n)

On Thursday, August 16, 2012 2:26:58 PM UTC+5:30, ram wrote:
>
>
> Hi,
>
>This is a microsoft question asked in our campus previous year. Anyone 
> having idea please share it here...
>
>Given an array of n elements A[n]. Write a program to create a new 
> array OUT[n], 
>
> which has its elements as multiplication of all the elements in the 
> input array A[n] except that element (i.e.) OUT[2] = A[0] * A[1] * A[3] * ? * 
> A[n-1]. 
>  Constraint is one should not use division operator.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/iqyLUMLQRS0J.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] MICROSOFT QUESTION

2012-08-16 Thread shady
for n elements, space used - 2n
can we do better ?

On Thu, Aug 16, 2012 at 3:20 PM, atul anand  wrote:

> input :   23   45
> temp1 : 26   24   120
> temp2 : 120  60  20   5
>
> for given input ..take tow temp array.
> temp1[i] = input[0] * input[1] * input[2] * input[3]..input[i]
> temp2[i] = input[i] * input [i + 1] * input[i + 2]input[n];
>
> now out[i] = temp1[i-1] * temp2[i+1];
>
>
> On Thu, Aug 16, 2012 at 2:26 PM, Hariraman R wrote:
>
>>
>> Hi,
>>
>>This is a microsoft question asked in our campus previous year. 
>> Anyone having idea please share it here...
>>
>>Given an array of n elements A[n]. Write a program to create a new 
>> array OUT[n],
>>
>> which has its elements as multiplication of all the elements in the 
>> input array A[n] except that element (i.e.) OUT[2] = A[0] * A[1] * A[3] * ? 
>> * A[n-1].
>>  Constraint is one should not use division operator.
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] MICROSOFT QUESTION

2012-08-16 Thread atul anand
input :   23   45
temp1 : 26   24   120
temp2 : 120  60  20   5

for given input ..take tow temp array.
temp1[i] = input[0] * input[1] * input[2] * input[3]..input[i]
temp2[i] = input[i] * input [i + 1] * input[i + 2]input[n];

now out[i] = temp1[i-1] * temp2[i+1];

On Thu, Aug 16, 2012 at 2:26 PM, Hariraman R  wrote:

>
> Hi,
>
>This is a microsoft question asked in our campus previous year. Anyone 
> having idea please share it here...
>
>Given an array of n elements A[n]. Write a program to create a new 
> array OUT[n],
>
> which has its elements as multiplication of all the elements in the 
> input array A[n] except that element (i.e.) OUT[2] = A[0] * A[1] * A[3] * ? * 
> A[n-1].
>  Constraint is one should not use division operator.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] MICROSOFT QUESTION

2012-08-16 Thread Hariraman R
Hi,

   This is a microsoft question asked in our campus previous year.
Anyone having idea please share it here...

   Given an array of n elements A[n]. Write a program to create a
new array OUT[n],
which has its elements as multiplication of all the elements
in the input array A[n] except that element (i.e.) OUT[2] = A[0] *
A[1] * A[3] * ? * A[n-1].
 Constraint is one should not use division operator.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Interview Question

2012-08-16 Thread gaurav yadav
@sahil Can you please explain your question with an example ?

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Interview Question

2012-08-16 Thread sahil taneja
Can any one help me with this ...Any DP solution?

On Sunday, 12 August 2012 17:48:07 UTC+5:30, sahil taneja wrote:
>
> Divide 2D array into 4 parts. Compute sum of each partition and get max 
> value from the four of them. For all possible partitions get min value of 
> such max values computed.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/tNlJhsd8r-MJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.