[algogeeks] Sorting a very large number of intergers

2013-06-13 Thread MAC
How would one sort 1 billion integers. .. I gave external sorting answer but he waned more .. What should i say ? Asked me to tell him how would the problem change if total of 4 threads are given. How would you solve ? thanks --mac -- You received this message because you are subscribed

[algogeeks] Infinite stream , identify distinct k kintegers

2013-06-01 Thread MAC
Given an infinite stream of integers with only k distinct integers, find those distinct integers. How would you modify your solution if k is also very large and cannot use hash table. thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] amazon f2f round question ..

2013-05-24 Thread MAC
kindly explain visualizing a balanced BST as a graph and unable to underdstand your point thanks --mac On Fri, May 24, 2013 at 6:04 AM, Avi Dullu avi.du...@gmail.com wrote: On Sat, May 11, 2013 at 10:29 AM, Aman Jain pureama...@gmail.com wrote: 2. from this no*de u*, again apply

[algogeeks] stack. Mid element in o(1)

2013-05-22 Thread MAC
that at push you store the middle element with the top element as well .. this would mean push would cease to be o(1)become o(n) .. . or is there some other trick ? thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from

Re: [algogeeks] Re: stack. Mid element in o(1)

2013-05-22 Thread MAC
i meant the middle elemnt so if 1 ,2,3 --top then 2 is mid value /.. accessing a middle element via the index is not right as it would mean you are not using it as a stack , but as an array .. thanks --mac On Wed, May 22, 2013 at 9:34 PM, Don dondod...@gmail.com wrote: Do you mean

[algogeeks] amazon f2f round question ..

2013-05-11 Thread MAC
Given an acyclic graph. Give an algorithm to find the pair of nodes which has the maximum distance between them, i.e. the maximum number of edges in between them any suggestion ? thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

[algogeeks] Re: Array of intergers with repeating elements

2013-05-08 Thread MAC
if one can explin me this i think this problem will get solved thanks --mac On Wed, May 8, 2013 at 12:02 AM, MAC macatad...@gmail.com wrote: I was asked this in recent amazon onsite interview and asked o write code Given an Array of integers . N elements occur k times and one element

[algogeeks] Re: Array of intergers with repeating elements

2013-05-08 Thread MAC
sry link was not pasted http://stackoverflow.com/questions/7338070/finding-an-element-in-an-array-where-every-element-is-repeated-odd-number-of-tim thanks --mac On Thu, May 9, 2013 at 12:40 AM, MAC macatad...@gmail.com wrote: if one can explin me this i think this problem will get solved

[algogeeks] Array of intergers with repeating elements

2013-05-07 Thread MAC
--mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.

[algogeeks] Interesting link on connecting town problem

2011-09-17 Thread MAC
Hi guys , Got an interesting link to share : http://www.youtube.com/watch?v=dAyDi1aa40Efeature=share It talks about *Maths Problem: Connect the towns solution (Motorway Problem) . * the solution finding by soap bubble is unique :) -- thanks --mac -- You received this message because you

[algogeeks] graph

2011-08-31 Thread MAC
. a cycle within a cycle. When i couldn't answer he asked how will you find strongly conected components of a graph (since it was follow up it MIGHT be related to solution but thought its good to share ) any thoughts on these 2 questions -- thanks --mac -- You received this message because you

Re: [algogeeks] graph

2011-08-31 Thread MAC
the planarity or two loops sharing common edge/s?? On Wed, Aug 31, 2011 at 8:46 PM, MAC macatad...@gmail.com wrote: Q The question asked in interview of a startup : suppose you have a graph as shown bellow : please see the attachment . The red dots are graph vertexes ( you can see 1 vertex

Re: [algogeeks] graph

2011-08-31 Thread MAC
@mohit : i disagree.. precisely bcoz of the reason you cited we can only check common nodes between cycles and nothing else .. please correct me if i am wrong On Wed, Aug 31, 2011 at 9:34 PM, mohit verma mohit89m...@gmail.com wrote: @ MAC , i think it was not right to inspect common nodes

[algogeeks] large nos

2011-08-24 Thread MAC
any thoughts ? if we have link lists to represent very large integer numbers how to implement multiply and devide operator -- thanks --mac -- 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: [algogeeks] Re: large nos

2011-08-24 Thread MAC
wrote: well if you store value in link list as a polynomial the you can do multiplication as cross product. eg. 345=3*100 + 4*10 + 5*1 On Wed, Aug 24, 2011 at 11:53 PM, Don dondod...@gmail.com wrote: Use NTL. Don On Aug 24, 12:43 pm, MAC macatad...@gmail.com wrote: any thoughts

[algogeeks] any good link?

2011-08-21 Thread MAC
can anyone suggest good link to review Algos and OS concepts -- thanks --mac -- 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

Re: [algogeeks] Re: any good link?

2011-08-21 Thread MAC
thanks .. any os specific ?? --mac On Sun, Aug 21, 2011 at 7:57 PM, Navneet navneetn...@gmail.com wrote: geeksforgeeks.org careercup.com On Aug 21, 7:13 pm, MAC macatad...@gmail.com wrote: can anyone suggest good link to review Algos and OS concepts -- thanks --mac -- You

Re: [algogeeks] COMMVAULT

2011-08-21 Thread MAC
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- thanks --mac -- 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

Re: [algogeeks] COMMVAULT

2011-08-21 Thread MAC
do u have any info on its pay scale etc ? if possible please share the same . On Sun, Aug 21, 2011 at 10:54 PM, MAC macatad...@gmail.com wrote: do u have any info on its pay scale etc ? if possibel plea On Sun, Aug 21, 2011 at 9:15 PM, cdr jay.kee...@gmail.com wrote: Plz tell me abt

Re: [algogeeks] Longest palindrome

2011-08-21 Thread MAC
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- thanks --mac -- 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: [algogeeks] Challenge

2011-08-20 Thread MAC
@Sanjay awesome aproach frd .. --mac On Sat, Aug 20, 2011 at 3:39 PM, Sanjay Rajpal srn...@gmail.com wrote: My previous argument was wrong. In the worst case, within a row, you may have to traverse the whole row, and rest other rows for just testing. Therefore O(m+n). But if we dont

[algogeeks] print all paths which sum up to a value.

2011-08-19 Thread MAC
came up and algo not just another program) -- thanks --mac -- 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: print all paths which sum up to a value.

2011-08-19 Thread MAC
10 20 30 4 66 7 now how do u make 60 = 20 +10+30 how do u make 36 :: 10 + 20 +6 30+6 On Fri, Aug 19, 2011 at 8:37 PM, Arun Vishwanathan aaron.nar...@gmail.comwrote: @mac: just to clear my understanding, u need to print paths

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

2011-08-18 Thread MAC
as per my understanding , you are increasing the minimum value so that it reaches closer to the maximum others that we are not moving right now . Why are you not moving the maximum instead ? basically i need the reason why you are doing so .. thanks --mac; On Thu, Aug 18, 2011 at 12:08 PM

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

2011-08-18 Thread MAC
the difference. Thanks Regards, Anantha Krishnan On Thu, Aug 18, 2011 at 1:01 PM, MAC macatad...@gmail.com wrote: as per my understanding , you are increasing the minimum value so that it reaches closer to the maximum others that we are not moving right now . Why are you not moving the maximum

[algogeeks] longest repeated substring

2011-08-18 Thread MAC
. abcdefcbcdfbcdefef has bcd and ef repeated multiple times but bcd count trie apraoch is fine , but in interview difficult to code ,.so definately some other solution is requested . please also give non-efficient , but easy to code solution if any -- thanks --mac -- You received this message because you

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

2011-08-17 Thread MAC
, and c = 14 if we had 4 arrays we would have wanted |a-b| + |b-c| + |c-d| +|d-a| where a E A , bEB , cEC and dED to be minimum ... -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

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

2011-08-17 Thread MAC
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- thanks --mac -- 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

[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 macatad...@gmail.com 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

Re: [algogeeks] sumitabha das unix ebook ?

2011-08-16 Thread MAC
/?ej74twjczauidil On Tue, Aug 16, 2011 at 9:57 AM, MAC macatad...@gmail.com wrote: does anyone has sumitabha das unix ebook for unix ? -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

[algogeeks] array question

2011-08-16 Thread MAC
Given an array of integers. Each number in the array repeats ODD number of times, but only 1 number repeated for EVEN number of times. Find that number. -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group

Re: [algogeeks] array question

2011-08-16 Thread MAC
, 2011 at 2:34 PM, sukran dhawan sukrandha...@gmail.comwrote: what is the complexity in which it has been done ? On Tue, Aug 16, 2011 at 1:41 PM, MAC macatad...@gmail.com wrote: Given an array of integers. Each number in the array repeats ODD number of times, but only 1 number repeated

[algogeeks] de shaw ? any link for questions ?

2011-08-15 Thread MAC
can someone please suggest sample ques for de shaw ?? some lnk would help -- thanks --mac -- 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

[algogeeks] sumitabha das unix ebook ?

2011-08-15 Thread MAC
does anyone has sumitabha das unix ebook for unix ? -- thanks --mac -- 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] Design .. how to attack ???

2011-08-12 Thread MAC
thanks guys .. so lets take the question we had design a car rental system .. so the interviewer can say , ok requirement is that you have a pool of cars , people come and book a car for a particular time slot if available . This is the most basic thing . so now what , what shd i do next --mac

Re: [algogeeks] Design .. how to attack ???

2011-08-12 Thread MAC
if someone can share one good solution , it would really help me. I am unable to form the answer to these questions --mac On Fri, Aug 12, 2011 at 1:15 PM, MAC macatad...@gmail.com wrote: thanks guys .. so lets take the question we had design a car rental system .. so the interviewer can

[algogeeks] Design .. how to attack ???

2011-08-11 Thread MAC
Hi guys , Can anyone help me in understanding what is expected when some some one asks you design a car rental system . Exactly what all is required to be told to the interviewer . -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

[algogeeks] student and company match algo

2011-08-03 Thread MAC
from companies and N preference lists from students. As a placement coordinator , with all student preferences and with all company preferences find the best matrix ie which student joins which company . -- thanks --mac -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] student and company match algo

2011-08-03 Thread MAC
by companies then by algo explained as PROPOSE REJECT ALGORITHM will assign std1 as amz , std2 as adb and std 3 as goog even though it might not be correct . i think i have misundesrtood this concept somehow . Sharing some link will be helpful to me . thanks --mac On Wed, Aug 3, 2011 at 2:28 PM, Ashish

Re: [algogeeks] Google Interview Question

2011-01-05 Thread MAC
...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- thanks --mac -- You received this message because you

[algogeeks] tarjan

2011-01-04 Thread MAC
can someone please share a non-wiki link for tarjan algorithm for strongly connected component . a video lecture link would be really nice .. in case you have understanding of how it works , please share your thoughts -- thanks --mac -- You received this message because you are subscribed

Re: [algogeeks] Re: Interview question amazon

2010-12-31 Thread MAC
example for 16 one more path can be 0 1 5 10 as well. Should algo return all the paths or just first one. On Dec 26, 10:08 pm, MAC macatad...@gmail.com wrote: you are given a bst where each node has a int value , parent pointer , and left and right pointers , write a function to find a path

[algogeeks] amazon interview question

2010-12-24 Thread MAC
is 1 .. so we will say 2nd row has maximum 1 -- thanks --mac -- 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

[algogeeks] Re: amazon interview question

2010-12-24 Thread MAC
true is 0 false is 1 .. so we will say 2nd row has maximum 1 and 3rd row has mximum 0 -- thanks --mac -- thanks --mac -- 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

[algogeeks] Interview question

2010-12-24 Thread MAC
Given a Binary Matrix of 0's and 1's. Write an algorithm to: 1) Print the largest Rectangular Sub-matrix with all 1's. 2)Print the largest Sub-matrix with all boundary elements 0. Explain your whole algorithm with an example. -- thanks --mac -- You received this message because you

Re: [algogeeks] Find a specific number in a special matrix.

2010-12-24 Thread MAC
.. till u find 5 or less than 5 hope this helps regards --mac On Sat, Dec 25, 2010 at 8:25 AM, yq Zhang zhangyunq...@gmail.com wrote: Suppose you have a matrix n*m. each column and row of the matrix is already sorted. For example: 1,2,3 2,3,4 4,5,6 All 3 rows and 3 columns of above matrix

[algogeeks] matrix row column

2010-12-22 Thread MAC
. The order of of the matching elements is the same. For example, If, i'th row matches with j'th column, and i'th row contains the elements - [1,4,5,6,3]. Then jth column would also contain the elements - [1,4,5,6,3]. Given an n x n matrix . -- thanks --mac -- You received this message because you

[algogeeks] valid paranthesis

2010-12-07 Thread MAC
how will u generate all valid paranthesis combinations ? -- thanks --mac -- 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

[algogeeks] k nearest points

2010-12-04 Thread MAC
Given set of n points (Xi, Yi), write a function to find k nearest points from origin. -- thanks --mac -- 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

[algogeeks] multisorted aarray

2010-11-24 Thread MAC
You are given a array with rows sorted and column sorted. You have to print entire array in sorted order .. any idea?? -- thanks --mac -- 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] half sorted array

2010-11-13 Thread MAC
you have an array of size n where first n/2 is sorted and the sencond half is sorted . You need to sort the entire array inplace Its second modification version is where first part is sorted and other is NOT sorted . You need to make entire sorted . -- thanks --mac -- You received this message

Re: [algogeeks] Debugging questions

2010-11-13 Thread MAC
(200) .. This is now recursive non changing call which will eat up stack space and hence cause segenttaion fault --mac On Sat, Nov 13, 2010 at 10:23 PM, sudhir mishra sudhir08.mis...@gmail.comwrote: *1st programe give output:199 but 2nd give Segmentation fault why* onle change in return

[algogeeks] zero sum subarray

2010-11-06 Thread MAC
an array contain +ve and -ve element, find subarray whose sum is 0 -- thanks --mac -- 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] Max to min heap

2010-10-20 Thread MAC
Convert a max heap to min heap -- thanks --mac -- 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

[algogeeks] Combinations with numbers

2010-10-06 Thread MAC
...5+0+0 and so on for n = 4, 5... -- thanks --mac -- 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

[algogeeks] binary matrix

2010-10-04 Thread mac adobe
is .. if such a matrix (square matrix does not exist) find one with maximum 1s . -- thanks --mac -- 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

Re: [algogeeks] Re: binary matrix

2010-10-04 Thread mac adobe
@chi .. can you please share what is this and how it resolves the issue at hand ? regards --mac On Mon, Oct 4, 2010 at 5:50 PM, Chi c...@linuxdna.com wrote: Traverse the matrix in z-order, or hilbert-order. This is a heuristic- algo. On Oct 4, 1:51 pm, mac adobe macatad...@gmail.com wrote

[algogeeks] repeating numbers in an array

2010-10-02 Thread mac adobe
with numbers repearting 3 times , Can you extend the solution to create array_x with elements repeating x times ? thanks --mac -- 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

[algogeeks] BST in BT

2010-09-25 Thread mac adobe
How would you identify a binary search tree of maximum nodes in a binary tree ? -- 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

Re: [algogeeks] Re: BST in BT

2010-09-25 Thread mac adobe
No parody .. that would be another doubt :( On Sat, Sep 25, 2010 at 11:03 PM, prodigy 1abhishekshu...@gmail.com wrote: By maintaining a current maximum and a global maximum. You do know how to verify a BT is BST . http://pastebin.com/xwXXTEnP On Sep 25, 9:04 pm, mac adobe macatad

Re: [algogeeks] Re: BST in BT

2010-09-25 Thread mac adobe
@parody :..and how would that find me a maximum size BST .. ?? ( for checking if this BT is BST i would do inorder traversal and see if it is increasing ) On Sun, Sep 26, 2010 at 11:10 AM, mac adobe macatad...@gmail.com wrote: No parody .. that would be another doubt :( On Sat, Sep