[algogeeks] Re: Bread Butter Brain

2012-02-15 Thread soundar
Registration Started.1 Rs at stake.Event starts at 7.30 PM today. -- 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] Re: c-aps

2011-08-07 Thread soundar
try indiabix.com -- 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

[algogeeks] Re: Google Interview Question

2011-01-06 Thread soundar
Maybe the code has lot of dynamic updations..So for each kind of i/ p there can be different places where the updated value is used. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] Re: Amazon Interview Question about Linked Lists

2010-12-23 Thread soundar
@shiva , U didn't check for the cycles.Since in question it is never mentioned about cycles u can add few steps to check cycles. (eg) 1 3 - 5 | | | | | | 4-3--3 -- You received this message because you are subscribed to the Google Groups Algorithm

[algogeeks] need help solving this ACM ICPC prelims problem

2010-10-18 Thread soundar
Problem D: Numbered Grid A grid of size N rows and M columns is filled with numbers, one in each cell. You start at the centre of the cell at the top-left corner (1,1) and your destination is the centre of the cell at the bottom- right corner(N,M). In each step, you are only allowed to move to

Re: [algogeeks] plz clear my basics

2010-10-08 Thread Soundar
it is very simple..just think that for sufficiently large n...the number of times the loop runs will be depend upon wat ? for example for(int i=0 to n) { for(int =0 to n) { //operations // } } for this the time complexity is O(n^2) because for every i..it runs n times. for lg n

Re: [algogeeks] Re: iTS aLL gOOGLE- iNTERVIEW

2010-10-03 Thread Soundar
for the first one it is permutation with repetition because the order matters n = no of digits When you have *n* things to choose from ... you have *n* choices each time! So when choosing *r* of them, the permutations are: *n × n × ... (r times) = nr* correct me if am wrong -- You received

Re: [algogeeks] Re: iTS aLL gOOGLE- iNTERVIEW

2010-10-03 Thread Soundar
here r is numbers we choose usually we have 10 numbers(in case of cell phone) we have 10[0.9] digits so 10^10 numbers are there...correct me if am wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: Fwd: [algogeeks] Prim's algorithm using min heap

2010-10-01 Thread Soundar
i couldn't find any link here. -- 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 email to algogeeks+unsubscr...@googlegroups.com. For

[algogeeks] Prim's algorithm using min heap

2010-09-30 Thread soundar
Please some one provide link or source code for Prim's algorithm using min heap Am having trouble with the implementation -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Re: Bitwise operator - Adobe

2010-09-27 Thread Soundar
#includeiostream using namespace std; int main() { int n,temp,ans=1; cin n; temp=n/8; temp++; cout hi temp\n; while(temp--) { temp=temp3; } cout temp; return 0; } -- You received this message because you are subscribed to the Google

Re: [algogeeks] Amazon Interview

2010-09-25 Thread Soundar
http://michael.dipperstein.com/rle/index.html Step 1. Set the previous symbol equal to an unmatchable value. Step 2. Read the next symbol from the input stream. Step 3. If the symbol is an EOF exit. Step 4. Write out the current symbol. Step 5. If the

Re: [algogeeks] Re: do this: two numbers with min diff

2010-09-23 Thread Soundar
Modeling Expert 's code is greedyit won't work for the test cases in which the optimal answer is does not lie between first two numbers.. On 9/23/10, Srinivas lavudyasrinivas0...@gmail.com wrote: can anyone post this answer pls?? -- You received this message because you are

Re: [algogeeks] help required...

2010-09-23 Thread Soundar
isn't it supposed to be only O(n) questions.? On 9/23/10, santhosh santhos4...@gmail.com wrote: if the possibilty of a person knowing other any1 based circular linked.. ie. 1/n.. then none becomes celebrity .. so wat to do in tat situation?? -- You received this message because you are

Re: [algogeeks] help required...

2010-09-23 Thread Soundar
And what if more than one person in that set?...let it be c. so u must ask ac+1(n-1) questions right? On 9/23/10, Soundar soundha...@gmail.com wrote: isn't it supposed to be only O(n) questions.? On 9/23/10, santhosh santhos4...@gmail.com wrote: if the possibilty of a person knowing

Re: [algogeeks] Re: Finding max for all positions of a moving window

2010-09-21 Thread Soundar
1)Sort the first 10 elements (first window) 2)initialise i=1,l=j=10 3)last element is the maximum(l=10) printf(a[l]) 4)i=i+1,j=j+1 if(a[j]a[l]) then printf(a[j]) l=j 5)else printf(a[l]) 6)if(i==l) repeat from step 1 for worst case it needs 10 sorts Correct if i am wrong -- You

Re: [algogeeks] Re: Finding max for all positions of a moving window

2010-09-21 Thread Soundar
You are correct ...It depends on the max element's index... -- 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 email to

[algogeeks] Re: print largest continue subsequent in int array

2010-09-19 Thread soundar
1)get the numbers 2)Sort the numbers 3)traverse from first number 4)if (a[i]==a[i+1]-1 ) { count++; sum+=(a[i]+a[i+1]) i++; } 5)if (summax) { end=count; max=sum; } 6)print down to count no of elements from a[end] will this algorithm wok?correct me if i am

Re: [algogeeks] Re: print largest continue subsequent in int array

2010-09-19 Thread Soundar
but the 2 consecutive numbers condition violatesfor -1 we must take only -1 only then we get -1 .If u add 2 negative numbers the answer is less than the 2 elements..So if the array contains ONLY negative numbers the maximum sum can't be achieved for 2 elements.Correct me if i am

Re: [algogeeks] Array Good One!!!!!!!!!!!!!!!!!!!!!!

2010-09-19 Thread Soundar
array index starting from 0 or 1? in the for loop i =length isn't it? If no please explain On 9/19/10, Ashish Goel ashg...@gmail.com wrote: this is google question take arrays before[] and after before[0]=1 after[length-1]=1; for (int i=1; ilength;i++) { before[i]=a[i]*before[i-1];

[algogeeks] Re: Yahoo Interview Question for Software Engineer/Developer about Algorithms

2010-09-18 Thread soundar
Even if u are connected to that person via some another friend it'll show the shortest chain by which you are connected to that person..So DFS will be optimum i guessWhy do you think it wouldn't be optimum.? -- You received this message because you are subscribed to the Google

[algogeeks] Re: num to words

2010-09-16 Thread soundar
we can use map mapint,string we have to manipulate 4 type of maps.. 1)1-9 2) 10 - 20 3)21-99 3)then hundreds,thousands correct me if i am wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] Re: num to words

2010-09-16 Thread soundar
for n=190 there it'll give segmentation error.but it contains only 19 elements you have to do like x=n/100 then one[x] -- 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

[algogeeks] Re: Given an array, find out if there exists a pair of nos. that adds up to a sum 'x'

2010-09-14 Thread soundar
#include iostream #include cstring #include conio.h using namespace std; int main() { int n,a[30],temp[30],x; cin n; memset(temp,0,sizeof(temp)); for(int i=0;in;i++) cin a[i]; cin x; temp[x-a[0]]=1; for(int i=1;in;i++) { if(temp[a[i]]==1)

[algogeeks] Re: Amazon Question

2010-09-14 Thread soundar
From first linked list set flag value in each traversal of node..then start from second linked list suppose if flag value is already set that is the intersection point correct me if i am wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

[algogeeks] Re: I want improve my algorithm??

2010-09-10 Thread soundar
www.spoj.pl www.topcoder.com/tc www.codechef.com Solve problems from these sites.. -- 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

[algogeeks] Re: how we can access 2nd element of an struct

2010-09-09 Thread soundar
It is giving me error.invalid cast from type ‘main()::node’ to type ‘char* -- 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 email to

[algogeeks] Re: how we can access 2nd element of an struct

2010-09-09 Thread soundar
can you explain?thanks in advance -- 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 email to algogeeks+unsubscr...@googlegroups.com. For more

[algogeeks] Re: how we can access 2nd element of an struct

2010-09-07 Thread soundar
u didn't give any name for the structure so it'll give error.correct me if i am wrong -- 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 email

[algogeeks] Re: How to print path of a node

2010-09-07 Thread soundar
try DFS -- 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 email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group

[algogeeks] Re: Spoj problem (dynamic programming)

2010-09-07 Thread soundar
post the problem link -- 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 email to algogeeks+unsubscr...@googlegroups.com. For more options,

[algogeeks] Re: Amazon interview Question (Array yet again!)

2010-09-05 Thread soundar
Finding the longest increasing sub sequence and comparing with the original array ...will this method work? -- 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

[algogeeks] Re: evaluate expression

2010-08-30 Thread soundar
Pl provide some test cases or more like examples -- 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 email to