[algogeeks] Re: Amazon Interview Question

2010-12-14 Thread sajj
you can use hash table for this dude. On Dec 14, 8:22 pm, Prims topcode...@gmail.com wrote: given some positive numbers output the numbers in decreasing order of frequency..in case of a tie print the number which occurred first for eg: 1,3,3,1,2,3,5,2,3 the output should be 11225 --

[algogeeks] Re: coin changing problem

2010-10-06 Thread sajj
Sarad Enna ketta enna reply panni irukka... On Oct 6, 5:47 am, sharad kumar aryansmit3...@gmail.com wrote: int denom(int Coin[],int n,int amount) { for(i=0;in;++i) { c=Coin[i]; for(j=c;j=amount;++j) { den[j]+=d[j-c]; } } return den[amount]; } On Wed, Oct 6, 2010 at 4:43 AM, pre

[algogeeks] Re: Do This

2010-10-06 Thread sajj
@Rahul: we have to insert the element to the position previous to where the given pointer is pointing... inserting nest to the element and swapping wont work i think correct me if im wrong... On Oct 6, 11:14 pm, RAHUL KUJUR kujurismonu2...@gmail.com wrote: @shobhan:  Ya,I got it!! -- You

[algogeeks] Re: Do This

2010-10-06 Thread sajj
In a single linked list its is not at all possible i hope correct me if im wrong ... with given one pointer and with out knowing where head is.. even if u know the position of the head it ll help you out for arriving the solution if and only if it is pointing to any of the following nodes 1 or 2