Re: [algogeeks] Re: |a-b| + |b-c| + |c-a|

2011-08-17 Thread Anantha Krishnan
Let, min_dif=INT_MAX 1.Sort the N arrays A,B,C. 2.Find the minimum and maximum of A[0],B[0],C[0]. 3.Take the difference between MAX-MIN values. 5.If the difference is less than min_dif then update min_dif and save all n values. 6.Now increment the index of the array which contains minimum

[algogeeks] Re: Amazon Interview Q

2011-08-17 Thread Vijay Kansal
We should return curr->next in the last statement of ur code On Aug 18, 7:08 am, Dipankar Patro wrote: > A slight change in above code: > make it > while(cur && cur->next) > ^^ other wise the code will crash at last element in a prefect list, with no > loop. > > On 18 August 2011 07:36, Dipankar

[algogeeks] Re: |a-b| + |b-c| + |c-a|

2011-08-17 Thread MAC
any suggestion on how to approach this problem ?? On Wed, Aug 17, 2011 at 10:37 PM, MAC wrote: > Given n arrays, find n number such that sum of their differences is > minimum. For e.g. if there are three arrays > > A = {4, 10, 15, 20} > B = {1, 13, 29} > C = {5, 14, 28} > > find three numbers

[algogeeks] exit() vs. _exit()

2011-08-17 Thread Amol Sharma
what is the difference between exit() and _exit http://ideone.com/MCzGy http://ideone.com/SxbwT when i am using exit() hello world is printed but with _exit() nothing gets printed though it ran successfully.plz explain why is so happening ?? -- Amol Sharma Third Year Student Computer Sci

Re: [algogeeks] Undefined behaviour for pointers to const values

2011-08-17 Thread Anurag Narain
+1 dipankar it shud be undefined i tried in dev cpp, the output is 3 3 3 -- 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 alg

Re: [algogeeks] Re: Output?? Why??

2011-08-17 Thread Dipankar Patro
Interesting thing I came across: http://stackoverflow.com/questions/1239938/c-accesses-an-array-out-of-bounds-gives-no-error-why On 18 August 2011 09:39, vartika aggarwal wrote: > Is it that there is no bounds checking in C while there is in C++ ? > > > On Thu, Aug 18, 2011 at 9:27 AM, Dipankar P

Re: [algogeeks] Re: Output?? Why??

2011-08-17 Thread vartika aggarwal
Is it that there is no bounds checking in C while there is in C++ ? On Thu, Aug 18, 2011 at 9:27 AM, Dipankar Patro wrote: > Thats new.. > Its not working in C++, where as in C it works like a charm. > > On 18 August 2011 08:57, vartika aggarwal > wrote: > >> @Aditi: That's because you haven

[algogeeks] Undefined behaviour for pointers to const values

2011-08-17 Thread Poised~
refer to this: http://ideone.com/SRPTC Shouldn't the answer be undefined behaviour? In the program I am changing the value of a constant int and the result is pretty amazing one. PS: Question was asked in Atrenta written. -- You received this message because you are subscribed to the Google Gr

Re: [algogeeks] Re: Output?? Why??

2011-08-17 Thread Dipankar Patro
Thats new.. Its not working in C++, where as in C it works like a charm. On 18 August 2011 08:57, vartika aggarwal wrote: > @Aditi: That's because you haven't changed the language to 'C' (while > working on ideone. It doesn't give an error in C) > > > On Thu, Aug 18, 2011 at 8:47 AM, aditi garg w

Re: [algogeeks] Re: Urgent...plz help

2011-08-17 Thread Amol Sharma
it will be max heap only.in which root denotes the largest number in your set of 100 smallest -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Thu, Aug 18, 2011 at 9:14 AM, aditi garg wrote: > @ dave : i hv one doubt,we wud be maintaining a max or a m

Re: [algogeeks] Re: Urgent...plz help

2011-08-17 Thread aditi garg
@ dave : i hv one doubt,we wud be maintaining a max or a min heap?? On Thu, Aug 18, 2011 at 9:11 AM, aditi garg wrote: > thank u so much dave :) > > > On Thu, Aug 18, 2011 at 8:44 AM, Dave wrote: > >> @Aditi: Form a max-heap of the first 100 numbers. Then as you read the >> remaining numbers, if

[algogeeks] Re: Urgent...plz help

2011-08-17 Thread XYZ
@Dave How did you get the complexity as O(n log k) On Aug 18, 8:14 am, Dave wrote: > @Aditi: Form a max-heap of the first 100 numbers. Then as you read the > remaining numbers, if a number is less than the root of the max-heap, > replace the root with it and restore the heap condition. When you

Re: [algogeeks] Re: Urgent...plz help

2011-08-17 Thread aditi garg
thank u so much dave :) On Thu, Aug 18, 2011 at 8:44 AM, Dave wrote: > @Aditi: Form a max-heap of the first 100 numbers. Then as you read the > remaining numbers, if a number is less than the root of the max-heap, > replace the root with it and restore the heap condition. When you > reach the en

Re: [algogeeks] Re: Output?? Why??

2011-08-17 Thread vartika aggarwal
@Aditi: That's because you haven't changed the language to 'C' (while working on ideone. It doesn't give an error in C) On Thu, Aug 18, 2011 at 8:47 AM, aditi garg wrote: > @payal: im getting compile time errors fr both the strings... > Chk dis :http://ideone.com/BRbkf > > > On Thu, Aug 18, 2011

Re: [algogeeks] Re: Output?? Why??

2011-08-17 Thread aditi garg
@payal: im getting compile time errors fr both the strings... Chk dis :http://ideone.com/BRbkf On Thu, Aug 18, 2011 at 4:12 AM, payal gupta wrote: > i modified the code a lil bit > #include > #include > int main() > { clrscr(); > char arr[5] = "geeks"; > printf("%s\n", arr); > char b[1]="t";

[algogeeks] Re: Urgent...plz help

2011-08-17 Thread Dave
@Aditi: Form a max-heap of the first 100 numbers. Then as you read the remaining numbers, if a number is less than the root of the max-heap, replace the root with it and restore the heap condition. When you reach the end of the million numbers, the heap will contain the smallest 100 numbers. If th

[algogeeks] Urgent...plz help

2011-08-17 Thread aditi garg
How to find the set of smallest 100 numbers out of 1 million numbers... -- 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: [algogeeks] Counting

2011-08-17 Thread Dipankar Patro
How about using vertices and edges format in graphs? - Traverse through each vertex in vertices list, and add all the edges to the edge list if they are not already present in the edge list. - Keep a counter to detect addition of new edges. On 18 August 2011 01:31, Luciano Junior wrote: > How ma

Re: [algogeeks] Amazon Interview Q

2011-08-17 Thread Dipankar Patro
A slight change in above code: make it while(cur && cur->next) ^^ other wise the code will crash at last element in a prefect list, with no loop. On 18 August 2011 07:36, Dipankar Patro wrote: > I have come up with this: > - Use only one pointer, NODE *cur > - initialize cur to headref > > - The

Re: [algogeeks] Amazon Interview Q

2011-08-17 Thread Dipankar Patro
I have come up with this: - Use only one pointer, NODE *cur - initialize cur to headref - The main loop: while (cur) { if(cur->next->prev != cur) break; cur=cur->next; } return cur; ^^ I think the code is self explanatory. It just uses the fact that at loop, the prev of next to current w

Re: [algogeeks]

2011-08-17 Thread saurabh singh
Using IPC functions On Thu, Aug 18, 2011 at 1:03 AM, UTKARSH SRIVASTAV wrote: > is there a way to pass some variables which are shared by both parents and > child and some which have different copies at the same time in fork > > -- > *UTKARSH SRIVASTAV > CSE-3 > B-Tech 3rd Year > @MNNIT ALLAH

Re: Re: [algogeeks] SPOJ 9199. Circular Track

2011-08-17 Thread vaibhavmittal11
divide absolute speeds by their GCD..and then the answer is their relative speed.. VM NSIT, Dwarka 3rd year, COE On , Prakash D wrote: any1?? On Sun, Aug 7, 2011 at 7:16 PM, Prakash D cegprak...@gmail.com> wrote: yeah, i also need to know the approach for this kind of problems asked in

[algogeeks] Re: shortest swapping rows

2011-08-17 Thread Brijesh Upadhyay
IT is the question.. You are given an N x N matrix with 0 and 1 values. You can swap any two adjacent rows of the matrix. Your goal is to have all the 1 values in the matrix below or on the main diagonal. That is, for each X where 1 ≤ X ≤ N, there must be no 1 values in row X that are to the

[algogeeks] Re: shortest swapping rows

2011-08-17 Thread Brijesh Upadhyay
Make an array of size n, and fill it with index of last 1 of corresponding row in the matrix.. as if row 0 has 1101100 , than arr[0]=4 . so we end up with an array containing last position of 1 in the respective row.. lets arr[4] is like 3,2,2,1... we have to make it 1,2,2,3.. so now apply fol

Re: [algogeeks] Amazon Interview Q

2011-08-17 Thread payal gupta
ys...i guess i misinterpreted..the question.. ma fault... On Thu, Aug 18, 2011 at 4:27 AM, Brijesh Upadhyay < brijeshupadhyay...@gmail.com> wrote: > At the node from where the loop just started.. anyway we could not use that > logic , coz it isnt circular linked list! > > -- > You received this m

Re: [algogeeks] Amazon Interview Q

2011-08-17 Thread Brijesh Upadhyay
At the node from where the loop just started.. anyway we could not use that logic , coz it isnt circular linked list! -- 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/

Re: [algogeeks] Amazon Interview Q

2011-08-17 Thread UTKARSH SRIVASTAV
WHERE will the back pointer of intersecting node will point? On Wed, Aug 17, 2011 at 3:47 PM, Brijesh Upadhyay < brijeshupadhyay...@gmail.com> wrote: > But it is not circular doubly linked list.,..so u could not traverse in > backward dirction from HEAD node.. > > -- > You received this message b

Re: [algogeeks] Amazon Interview Q

2011-08-17 Thread Brijesh Upadhyay
But it is not circular doubly linked list.,..so u could not traverse in backward dirction from HEAD node.. -- 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/-/

Re: [algogeeks] Re: Output?? Why??

2011-08-17 Thread payal gupta
i modified the code a lil bit #include #include int main() { clrscr(); char arr[5] = "geeks"; printf("%s\n", arr); char b[1]="t"; printf("%s\n",b); getchar(); return 0; } the output in dis case is somewhat diff..cud someone explain... On Thu, Aug 18, 2011 at 3:28 AM, Ayush Kapoor wrote: >

[algogeeks] shortest swapping rows

2011-08-17 Thread cegprakash
http://www.spoj.pl/problems/HAROWS/ this is a spoj problem.. how to solve this problem?? -- 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 e

Re: [algogeeks] SPOJ 9199. Circular Track

2011-08-17 Thread Prakash D
any1?? On Sun, Aug 7, 2011 at 7:16 PM, Prakash D wrote: > yeah, i also need to know the approach for this kind of problems asked in > many places > > > On Sun, Aug 7, 2011 at 3:58 PM, arvind kumar wrote: > >> Hi >> Can any1 pls help me in solving this? >> Two persons are running on a circular t

Re: [algogeeks] Amazon Interview Q

2011-08-17 Thread payal gupta
if we take 2 pointers initialized with the start node with one moving in forward direction and other in backward direction and execute until both point to same node .it cud be workin faster i suppose... On Thu, Aug 18, 2011 at 1:21 AM, Piyush Sinha wrote: > We all knw hw to find a loop in a singl

Re: [algogeeks] Re: Output?? Why??

2011-08-17 Thread Ayush Kapoor
There is no null character in this string,as its length is 5 and the number of characters is 5(Geeks),and printf("%s",arr) should output the string till the null character On Thu, Aug 18, 2011 at 2:40 AM, bihari wrote: > upto null charchter.. > > -- > You received this message becaus

[algogeeks] Re: Output?? Why??

2011-08-17 Thread bihari
upto null charchter.. -- 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

[algogeeks] c

2011-08-17 Thread bihari
How to prevent the compiler to alter the value of i in statement: const int i=2; Just give the idea about the implementation of const int i=somevalue; -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge

[algogeeks] Can anybody provide source code or suggest how to write one for median of median algo

2011-08-17 Thread Ankur Garg
I found it a bit tough..Can anyone suggest code for it -- 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...@googl

[algogeeks] Counting

2011-08-17 Thread Luciano Junior
How many different ways are there to count how many streets have in a city, based on the city map? What algorithms can be used for response this question ? -- Luciano Soares Pinheiro Jr. Analista desenvolvedor Sr. -- You received this message because you

[algogeeks] Amazon Interview Q

2011-08-17 Thread Piyush Sinha
We all knw hw to find a loop in a singly linked list (Using hare and tortoise method)..what if the linked list is a doubly linked list?can we do it smthn better than hare n tortoise method using the advantage of the doubly linked list? -- *Piyush Sinha* *IIIT, Allahabad* *+91-7483122727* *

[algogeeks]

2011-08-17 Thread UTKARSH SRIVASTAV
is there a way to pass some variables which are shared by both parents and child and some which have different copies at the same time in fork -- *UTKARSH SRIVASTAV CSE-3 B-Tech 3rd Year @MNNIT ALLAHABAD* -- You received this message because you are subscribed to the Google Groups "Algorithm G

Re: [algogeeks] Re: Algorithms For Interviews

2011-08-17 Thread Bhavani Pradeep
http://www.mediafire.com/?a2ia1j1i0q0pet1 -- 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.

[algogeeks] Re: apti! solve this!

2011-08-17 Thread Don
Are we assuming a flat earth? On Aug 17, 9:13 am, priya ramesh wrote: >  A moves 3 kms east from his starting point . He then travels 5 kms north. > From that point he moves 8 kms to the east.How far is A from his starting > point? -- You received this message because you are subscribed to the

Re: [algogeeks] Re: Algorithms For Interviews

2011-08-17 Thread jagrati verma
plz who have the pdf of this book plz mail it for algogeeks grp.. On Thu, Aug 18, 2011 at 12:10 AM, SANDEEP CHUGH wrote: > mail to me too > > On Thu, Aug 18, 2011 at 12:04 AM, rajesh yerneni > wrote: >> >> I could not download the file, please mail it to me tooo... >> >> -- >> You re

[algogeeks] Re: apti! solve this!

2011-08-17 Thread Dave
If the moves had been 3 km east, 5 km north, and 9 km east (instead of 8), the answer would have been 13. Dave On Aug 17, 9:25 am, priya ramesh wrote: > the answer is given as 13... even i got root(146) -- You received this message because you are subscribed to the Google Groups "Algorithm Ge

[algogeeks] Output?? Why??

2011-08-17 Thread noobcoder
#include int main() { char arr[5] = "geeks"; printf("%s", arr); getchar(); return 0; } -- 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, se

[algogeeks] Re: brain teaser

2011-08-17 Thread Don
We know that n+m+s+carry < 10. So n<7. We also know that either n+n+n or o+o+o > 9 because there must be a carry to make those two columns add to a different value. We can start eliminating values for n. If n is 1, o would have to be 7 to make the second row work out. But then u and e would both be

[algogeeks] Re: EMC software ???

2011-08-17 Thread htross
anybody who wrote on campus written test please put up the questions.please help... On Aug 17, 10:16 pm, MAC wrote: > http://www.careercup.com/page?pid=emc-interview-questions > > this might help u :) best of luck > > > > > > > > > > On Wed, Aug 17, 2011 at 10:42 PM, htross wrote: > > please

Re: [algogeeks] brain teaser

2011-08-17 Thread priya ramesh
me too :P On Thu, Aug 18, 2011 at 12:19 AM, Bhavani Pradeep wrote: > oh yeah... just stopped thinking after finding one solution :P > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@google

Re: [algogeeks] brain teaser

2011-08-17 Thread Bhavani Pradeep
oh yeah... just stopped thinking after finding one solution :P -- 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.

Re: [algogeeks] brain teaser

2011-08-17 Thread priya ramesh
2442 +1442 +5442 -- 9326 2442 5442 1442 9326 - other answers :) -- 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 emai

Re: [algogeeks] brain teaser

2011-08-17 Thread Bhavani Pradeep
Im not able to think of any other answer other than this!! -- 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...@g

Re: [algogeeks] brain teaser

2011-08-17 Thread priya ramesh
yup it's correct now :) :) -- 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 option

Re: [algogeeks] brain teaser

2011-08-17 Thread Bhavani Pradeep
sorry earlier answer was wrong!! 4114 +5114 +0114 =9342 Assuming each alphabet has a unique digit -- 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 gr

Re: [algogeeks] brain teaser

2011-08-17 Thread priya ramesh
@bhavani : i too got a similar answer :) I guess it has several answers! -- 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: [algogeeks] Re: Algorithms For Interviews

2011-08-17 Thread SANDEEP CHUGH
mail to me too On Thu, Aug 18, 2011 at 12:04 AM, rajesh yerneni wrote: > I could not download the file, please mail it to me tooo... > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googl

Re: [algogeeks] brain teaser

2011-08-17 Thread Bhavani Pradeep
4114 +2114 +0114 =6342 Just guess work!! -- 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

Re: [algogeeks] Re: an amazing amazon question!

2011-08-17 Thread sagar pareek
and of course y can't be '1' On Thu, Aug 18, 2011 at 12:01 AM, rohit wrote: > No third time he just say same digit are appearing but you write > interchanging . > correct me if i am wrong! > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" grou

Re: [algogeeks] brain teaser

2011-08-17 Thread shady
give one reason why i shouldnt ban you On Wed, Aug 17, 2011 at 11:53 PM, priya ramesh < love.for.programm...@gmail.com> wrote: >noon > + moon > + soon > = june > > find the values of the alphabets to satisfy this equation > > -- > You received this message because you are subscribed to the Go

[algogeeks] Re: Algorithms For Interviews

2011-08-17 Thread rajesh yerneni
I could not download the file, please mail it to me tooo... -- 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...@

Re: [algogeeks] Re: an amazing amazon question!

2011-08-17 Thread rohit
No third time he just say same digit are appearing but you write interchanging . correct me if i am wrong! -- 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/-/

Re: [algogeeks] Re: an amazing amazon question!

2011-08-17 Thread priya ramesh
@sagar, aditya: +100 superb explaination!! -- 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.

Re: [algogeeks] Re: an amazing amazon question!

2011-08-17 Thread sagar pareek
@Douglas nopes there is only one solution here it is * See answer is in the question ques is saying that first there is 2 digit number after 1 hour number interchanged so let numbers be xy then yx now third it is saying that both numbers are again repeating and we also know that yx>xy and

[algogeeks] brain teaser

2011-08-17 Thread priya ramesh
noon + moon + soon = june find the values of the alphabets to satisfy this equation -- 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 emai

Re: [algogeeks] Re: an amazing amazon question!

2011-08-17 Thread sagar pareek
@rajul dave 45 miles per hour is uniform speed On Wed, Aug 17, 2011 at 11:49 PM, rajul jain wrote: > but its speed is uniform i think Don answer is right > > > On Wed, Aug 17, 2011 at 11:42 PM, Douglas Diniz wrote: > >> There are infinite solutions with this logic, because the third >> mileston

Re: [algogeeks] Re: an amazing amazon question!

2011-08-17 Thread rajul jain
but its speed is uniform i think Don answer is right On Wed, Aug 17, 2011 at 11:42 PM, Douglas Diniz wrote: > There are infinite solutions with this logic, because the third > milestone can have more than 2 digits. > > On Wed, Aug 17, 2011 at 3:08 PM, sagar pareek > wrote: > > @rajul > > > > 61

Re: [algogeeks] apti! solve this!

2011-08-17 Thread aditya kumar
answer has to be sqrt(146) . 13 cant be the answer On Wed, Aug 17, 2011 at 7:55 PM, priya ramesh < love.for.programm...@gmail.com> wrote: > the answer is given as 13... even i got root(146) > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" gro

Re: [algogeeks] Re: an amazing amazon question!

2011-08-17 Thread Douglas Diniz
There are infinite solutions with this logic, because the third milestone can have more than 2 digits. On Wed, Aug 17, 2011 at 3:08 PM, sagar pareek wrote: > @rajul > > 61-16 =45 > > its not 55 miles per hour > > On Wed, Aug 17, 2011 at 11:33 PM, Don wrote: >> >> Actually you are all wrong. His

Re: [algogeeks] Re: an amazing amazon question!

2011-08-17 Thread rajul jain
thnx for correcting me On Wed, Aug 17, 2011 at 11:38 PM, sagar pareek wrote: > @rajul > > 61-16 =45 > > its not 55 miles per hour > > > On Wed, Aug 17, 2011 at 11:33 PM, Don wrote: > >> Actually you are all wrong. His uniform speed was zero, and he was >> sitting by milestone 44 the whole time.

[algogeeks] Re: Possible solutions to these sort of Questions

2011-08-17 Thread Yasir
For questions specifically asking about test cases, I would suggest following 3 step approach: First think of a* basic flow that MUST work for the application* (what is expected with the application. Firstly make it clear with you interviewer). eg: 1) User should be able to open Notepad w

Re: [algogeeks] Re: an amazing amazon question!

2011-08-17 Thread sagar pareek
@rajul 61-16 =45 its not 55 miles per hour On Wed, Aug 17, 2011 at 11:33 PM, Don wrote: > Actually you are all wrong. His uniform speed was zero, and he was > sitting by milestone 44 the whole time. > > On Aug 17, 11:58 am, priya ramesh > wrote: > > A car is traveling at a uniform speed.The d

Re: [algogeeks] an amazing amazon question!

2011-08-17 Thread Prithu Banerjee
@sagar. Can you please explain how you got the solution? Is there any proper math involved?? On Wed, Aug 17, 2011 at 10:35 PM, sagar pareek wrote: > 16, 61, 106 average speed is 45 miles/hour > > > On Wed, Aug 17, 2011 at 10:28 PM, priya ramesh < > love.for.programm...@gmail.com> wrote: > >> A c

[algogeeks] Re: an amazing amazon question!

2011-08-17 Thread Don
Actually you are all wrong. His uniform speed was zero, and he was sitting by milestone 44 the whole time. On Aug 17, 11:58 am, priya ramesh wrote: > A car is traveling at a uniform speed.The driver sees a milestone showing a > 2-digit number. After traveling for an hour the driver sees another >

Re: [algogeeks] an amazing amazon question!

2011-08-17 Thread rajul jain
what abou 16 , 61 , 116 so avg 55 m/hr On Wed, Aug 17, 2011 at 10:35 PM, sagar pareek wrote: > 16, 61, 106 average speed is 45 miles/hour > > > On Wed, Aug 17, 2011 at 10:28 PM, priya ramesh < > love.for.programm...@gmail.com> wrote: > >> A car is traveling at a uniform speed.The driver sees a m

Re: [algogeeks] an amazing amazon question!

2011-08-17 Thread Aditya Virmani
+1 sagar pareek... i used the following approach: let the num be xy so... (10y + x) - (10x + y) is the distance travelled in 1 hr... now, the the next milestone must be a three digit number, which can be of following compostion: 1xy or xzy or yzx whr 0<=z<9 coz aif z=9, distance travlled in tht hr

Re: [algogeeks] an amazing amazon question!

2011-08-17 Thread Rohit Srivastava
logic plz? On Wed, Aug 17, 2011 at 10:35 PM, sagar pareek wrote: > 16, 61, 106 average speed is 45 miles/hour > > > On Wed, Aug 17, 2011 at 10:28 PM, priya ramesh < > love.for.programm...@gmail.com> wrote: > >> A car is traveling at a uniform speed.The driver sees a milestone showing >> a 2-digi

Re: [algogeeks] an amazing amazon question!

2011-08-17 Thread Romil .......
@Sagar: Could you please explain how you did it?? On Wed, Aug 17, 2011 at 10:35 PM, sagar pareek wrote: > 16, 61, 106 average speed is 45 miles/hour > > > On Wed, Aug 17, 2011 at 10:28 PM, priya ramesh < > love.for.programm...@gmail.com> wrote: > >> A car is traveling at a uniform speed.The dri

Re: [algogeeks] J.P.MORGAN

2011-08-17 Thread anitha sekaran
Its both .. :) On Wed, Aug 17, 2011 at 8:23 PM, tejaswini wrote: > what r da questions aked in written test??..i mean is it general aptitude > test or technical based one > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view th

Re: [algogeeks] Re: EMC software ???

2011-08-17 Thread MAC
http://www.careercup.com/page?pid=emc-interview-questions this might help u :) best of luck On Wed, Aug 17, 2011 at 10:42 PM, htross wrote: > please reply soon anyone...times running out. > > On Aug 17, 7:54 pm, htross wrote: > > hi everyone...what kind of questions will be asked in EMC fi

[algogeeks] Re: EMC software ???

2011-08-17 Thread htross
please reply soon anyone...times running out. On Aug 17, 7:54 pm, htross wrote: > hi everyone...what kind of questions will be asked in EMC first > round???please help.. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to thi

[algogeeks] |a-b| + |b-c| + |c-a|

2011-08-17 Thread MAC
Given n arrays, find n number such that sum of their differences is minimum. For e.g. if there are three arrays A = {4, 10, 15, 20} B = {1, 13, 29} C = {5, 14, 28} find three numbers a, b, c such that |a-b| + |b-c| + |c-a| is minimum where a E A , bEB , cEC . Here the answer is a = 15, b = 13,

[algogeeks] Re: GS apti ques!

2011-08-17 Thread gaurav kumar
@priya ... which is your colg ? On Aug 17, 10:01 pm, gaurav kumar wrote: > any more questions plzz..gs is coming to ur colg on 23rd ...technical > also ? > > > > > > > > > > Even i got 0.212 > > > > *Muthuraj R > > > IV th Year , ISE > > > PESIT , Bangalore* > > > > On Wed, Aug 17, 2011 at 4:42 P

Re: [algogeeks] an amazing amazon question!

2011-08-17 Thread sagar pareek
16, 61, 106 average speed is 45 miles/hour On Wed, Aug 17, 2011 at 10:28 PM, priya ramesh < love.for.programm...@gmail.com> wrote: > A car is traveling at a uniform speed.The driver sees a milestone showing a > 2-digit number. After traveling for an hour the driver sees another > milestone with

[algogeeks] Re: GS apti ques!

2011-08-17 Thread gaurav kumar
any more questions plzz..gs is coming to ur colg on 23rd ...technical also ? > > Even i got 0.212 > > > *Muthuraj R > > IV th Year , ISE > > PESIT , Bangalore* > > > On Wed, Aug 17, 2011 at 4:42 PM, Romil ... wrote: > > >> Kumar's approach would not do perhaps. I simply eliminated the undesir

[algogeeks] Re: Prime numbers

2011-08-17 Thread Don
_(n,1,n,0) is true if n is prime. I set out to create an O(n^n) algorithm. It essentially computes the product of every possible set of n integers in the range (1..n-1). If any of those products equal n, the number is composite. You will notice that the program does not use the * operator to perfo

[algogeeks] an amazing amazon question!

2011-08-17 Thread priya ramesh
A car is traveling at a uniform speed.The driver sees a milestone showing a 2-digit number. After traveling for an hour the driver sees another milestone with the same digits in reverse order.After another hour the driver sees another milestone containing the same two digits. What is the average sp

Re: [algogeeks] Re: C output

2011-08-17 Thread rajeev bharshetty
No the warning in gcc is ibm1.c: In function ‘main’: ibm1.c:7:19: warning: initialization discards qualifiers from pointer target type On Wed, Aug 17, 2011 at 11:50 AM, venkat wrote: > yes u r correct > > On Aug 16, 8:22 pm, Sanjay Rajpal wrote: > > This is becuase "Hello" is a constant strin

[algogeeks] Re: Fork

2011-08-17 Thread siva viknesh
search in this group itself .. there are gud questions with nice explanations On Aug 17, 7:27 pm, saurabh singh wrote: > Kindly suggest some references on forkI know what it is and how it > works.Its just that there are few programs related with recursion that > I have to do using fork.I am

Re: [algogeeks] Max possible numbers in incremental order

2011-08-17 Thread Sanjay Rajpal
@Romil : what u r talking about is case of substring, check out the problem again. In substrings we need continuously, not in subsequences. and I have said longest increasing subsequence, not longest common subsequence On 8/17/11, Shiv Kumar Malik wrote: > i think this can be solved by dynamic p

Re: [algogeeks] Re: matrix question ???!!!!!!!!!!??????????

2011-08-17 Thread aditya kumar
@dave : +1 On Wed, Aug 17, 2011 at 4:05 PM, Dave wrote: > @Anika: You don't have to find the max and min elements of the entire > array to find a row that doesn't contain either of them. If you scan 3 > rows, you will find a row that contains the max of those three rows, > another that contains t

[algogeeks] Re: Algorithms For Interviews

2011-08-17 Thread rohit kumra
Please mail it to me also!! On Aug 17, 2:22 pm, Sanjay Rajpal wrote: > @Raman : mail kar de bhai abhi. > > Sanjay Kumar > B.Tech Final Year > Department of Computer Engineering > National Institute of Technology Kurukshetra > Kurukshetra - 136119 > Haryana, India > > On Wed, Aug 17, 2011 at 2:20

Re: [algogeeks] De shaw ques!

2011-08-17 Thread aditya kumar
i guess if the option is provided it would have been an appropiate question . On Wed, Aug 17, 2011 at 6:02 PM, Rohit Srivastava wrote: > +1 to nitin > > > On Wed, Aug 17, 2011 at 6:02 PM, Romil ... wrote: > >> People this is not the way to approach this one. This question seems to be >> unfai

Re: [algogeeks] Factorial Algorithms

2011-08-17 Thread Gaurav Menghani
Sure. On Wed, Aug 17, 2011 at 4:33 PM, Nitin Nizhawan wrote: > @Gaurav , if you are able to find any resource that explains the logic of > these algos, please let me know. > > On Sat, Aug 13, 2011 at 9:50 AM, Gaurav Menghani > wrote: >> >> Thanks for the link. I was unaware of such algorithms. T

Re: [algogeeks] knight's tour - variant

2011-08-17 Thread Shiv Kumar Malik
what is the starting position of knight. -- 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. F

Re: [algogeeks] Max possible numbers in incremental order

2011-08-17 Thread Shiv Kumar Malik
i think this can be solved by dynamic programming. this is very similar to the knapsack problem. 1. We have to maximize profit by increasing the length of array. 2. principle of optimality also holds here. considering the points solution ca be visualized easily. -- You received this message be

Re: [algogeeks] mutex

2011-08-17 Thread rajeev bharshetty
Mutexes are used for synchronisation. Basically they allow only one process to access any shared memory at a time thus helping sync among processes. On Wed, Aug 17, 2011 at 9:29 PM, Aman Kumar wrote: > can we use mutex for synchronization? > > if yes why? > > -- > You received this message beca

[algogeeks] mutex

2011-08-17 Thread Aman Kumar
can we use mutex for synchronization? if yes why? -- 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...@googlegro

Re: [algogeeks] Max possible numbers in incremental order

2011-08-17 Thread Romil .......
@Sanjay: In the longest common subsequence we have the continuous elements but here he has placed no restriction on that.. On Wed, Aug 17, 2011 at 9:06 PM, Raghavan wrote: > @sanjay: > > Thats cool > > > On Wed, Aug 17, 2011 at 9:02 PM, Sanjay Rajpal wrote: > >> I think it is similar to longest

Re: [algogeeks] Max possible numbers in incremental order

2011-08-17 Thread Raghavan
@sanjay: Thats cool On Wed, Aug 17, 2011 at 9:02 PM, Sanjay Rajpal wrote: > I think it is similar to longest increasing subsequence problem . > Try the following link : > http://en.wikipedia.org/wiki/Longest_increasing_subsequence > > Sanjay Kumar > B.Tech Final Year > Department of Computer En

Re: [algogeeks] Re: Prime numbers

2011-08-17 Thread Sanjay Rajpal
@Don : can you plz explain it ? Sanjay Kumar B.Tech Final Year Department of Computer Engineering National Institute of Technology Kurukshetra Kurukshetra - 136119 Haryana, India -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to thi

Re: [algogeeks] Max possible numbers in incremental order

2011-08-17 Thread Sanjay Rajpal
I think it is similar to longest increasing subsequence problem . Try the following link : http://en.wikipedia.org/wiki/Longest_increasing_subsequence Sanjay Kumar B.Tech Final Year Department of Computer Engineering National Institute of Technology Kurukshetra Kurukshetra - 136119 Haryana, India

[algogeeks] Re: Prime numbers

2011-08-17 Thread Don
I wrote it. Can you figure out how it works? Don On Aug 17, 1:25 am, Nitin Nizhawan wrote: > Hi Dod, > >   Could you pls expalin what this algorithm is doing and from where you got > it. > > Thanks > Nitin > > On Wed, Aug 17, 2011 at 2:56 AM, Don wrote: > > I wrote a program to print prime numbe

  1   2   >