[algogeeks] Re: [Google] Finds all the elements that appear more than n/3 times

2012-07-11 Thread sachin goyal
To Mr. B how will you find median in O(n) time? please elaborate. On Wednesday, July 11, 2012 4:01:43 AM UTC+5:30, Mr.B wrote: I found a similar solution looking somewhere else. The solution for this problem is: a. There can be atmost 3 elements (only 3 distinct elements with each

Re: [algogeeks] Re: [Google] Finds all the elements that appear more than n/3 times

2012-07-11 Thread Navin Kumar
@sachin: you can find median in linear sort. http://valis.cs.uiuc.edu/~sariel/research/CG/applets/linear_prog/median.html On Wed, Jul 11, 2012 at 12:28 PM, sachin goyal sachingoyal@gmail.comwrote: To Mr. B how will you find median in O(n) time? please elaborate. On Wednesday, July 11,

Re: [algogeeks] Re: [Google] Finds all the elements that appear more than n/3 times

2012-07-11 Thread Navin Kumar
@sachin: http://valis.cs.uiuc.edu/~sariel/research/CG/applets/linear_prog/median.html On Wed, Jul 11, 2012 at 12:28 PM, sachin goyal sachingoyal@gmail.comwrote: To Mr. B how will you find median in O(n) time? please elaborate. On Wednesday, July 11, 2012 4:01:43 AM UTC+5:30, Mr.B

[algogeeks] Re: [Linkedlist] Given only a pointer to a node to be deleted in a singly linked list how you handle deleting last node

2012-07-11 Thread invictus
Well, we can do one thing but it might not work in all cases. First of all you need to know the node structure. Assume it has an int and a next pointer. Assumption - Memory allocation for nodes did not happened at random location but uniformly. 1. Find out the memory address contained in the

Re: [algogeeks] Directi Interview Ques

2012-07-11 Thread Sravan Kumar Reddy Ganta
@abinesh: The solution given has a very very high complexity. as it finds all possiblilities and tests each one of it. is it *n*[(2n!)/(n! * n!)]* -- This is exponential solution. I am not sure but, there must be a DP solution to this . --Sravan Reddy On Wed, Jul 11, 2012 at 12:15 AM, arumuga

[algogeeks] Re: [Linkedlist] Given only a pointer to a node to be deleted in a singly linked list how you handle deleting last node

2012-07-11 Thread Mr.B
Even if assuming the allocation is uniform. Knowing the address of previous node is the limitation on SLL in constant time. Also, if we know the address of previous node. we are done. But, finding it will take O(n) time. On Wednesday, 11 July 2012 03:36:46 UTC-4, invictus wrote: Well, we can

[algogeeks] Re: how to print tata from tatapower using only strcat and strcpy???

2012-07-11 Thread jatin sethi
char str[5] , *p , str1[]=tatapower; p=str1 while(*p) { if(*p=='t'||*p=='a') if(str==NULL) strcpy(str,*p); else strcat(str,*p); p++; } On Tuesday, 10 July 2012 16:15:16 UTC+5:30, amrit harry wrote: -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Re: MS Q

2012-07-11 Thread ANKIT BHARDWAJ
anybody have informaton regarding questions asked in written and interview of capillary technology for developer post please share at bhardwaj.ankit...@gmail.com thanks in advance. On 5/22/12, Navin.nitjsr navin.nit...@gmail.com wrote: If the matrix is 4-connected, we can use the same matrix.

[algogeeks] Need links for Problem solving interview questions(non DS and algorithmic) probably with how to reach a solution

2012-07-11 Thread raghavan M
hi I am looking for some web links where i can find problem solving questions and method that one can use to solve the problems that are asked in interviews.Please let me know if you came across one. Thanks Rag -- You received this message because you are subscribed to the Google Groups

[algogeeks]

2012-07-11 Thread wentworth miller
hi .. can anybody tell the Nth term of the following series... 9 96 685 4992. -- 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

Re: [algogeeks] Re: [Google] Finds all the elements that appear more than n/3 times

2012-07-11 Thread Nishant Pandey
can some body please explain voting algo to me . On Wed, Jul 11, 2012 at 12:42 PM, Navin Kumar algorithm.i...@gmail.comwrote: @sachin: http://valis.cs.uiuc.edu/~sariel/research/CG/applets/linear_prog/median.html On Wed, Jul 11, 2012 at 12:28 PM, sachin goyal

Re: [algogeeks] Need links for Problem solving interview questions(non DS and algorithmic) probably with how to reach a solution

2012-07-11 Thread Rahul Kumar Patle
http://uva.onlinejudge.org/index.php http://www.careercup.com/ http://www.codershunt.com/ http://www.cs.sunysb.edu/~skiena/392/programs/ https://www.interviewstreet.com/challenges/# and in last topcoder, codechef and stack overflow all three are best... On Wed, Jul 11, 2012 at 10:37 AM, raghavan

Re: [algogeeks] Re: seperate diff types of coins

2012-07-11 Thread Dave
@Gupta: Given the balance scale and only the eight coins, with no knowledge of the values of their weights, here is an algorithm, probably not optimal, to label each coin x, y, a, or b, with three x's, three y's, one a, and one b. 1. Weigh the coins pairwise, c1 vs c2, then min(c1,c2) vs