[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

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 wrote: > > On Sat, May 11, 2013 at 10:29 AM, Aman Jain wrote: > >> 2. from this no*de u*, again apply* dfs* to find longe

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 wrote: > Do you mean the middle posit

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

2013-05-22 Thread MAC
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 un

[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

[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 wrote: > if one can explin me this i think this problem will get solved > > > th

[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 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 > occ

[algogeeks] Array of intergers with repeating elements

2013-05-07 Thread MAC
T even . thanks --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=dAyDi1aa40E&feature=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

[algogeeks] need info

2011-09-04 Thread MAC
HI guys , need to know what is a company commvault ,. Is that a good comp and is it a good pay master -- 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@googlegrou

Re: [algogeeks] Find Max Sum Value Pairs

2011-09-01 Thread MAC
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 this group at > htt

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 wrote: > @ MAC , i think it was not right to inspect common nodes in different >

Re: [algogeeks] graph

2011-08-31 Thread MAC
or two loops sharing common edge/s?? > > > On Wed, Aug 31, 2011 at 8:46 PM, MAC 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 verte

[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 becaus

Re: [algogeeks] Re: large nos

2011-08-24 Thread MAC
com> 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 wrote: > > Use NTL. > > Don > > > > On Aug 24, 12:43 pm, MAC wrote:

[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

Re: [algogeeks] Longest palindrome

2011-08-21 Thread MAC
s@googlegroups.com. > To unsubscribe from this group, send email 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

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 wrote: > do u have any info on its pay scale etc ? if possibel plea > > > On Sun, Aug 21, 2011 at 9:15 PM, cdr wrote: > >> Plz tell me abt the written test

Re: [algogeeks] COMMVAULT

2011-08-21 Thread MAC
scr...@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 al

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 wrote: > geeksforgeeks.org > careercup.com > > On Aug 21, 7:13 pm, MAC wrote: > > can anyone suggest good link to review Algos and OS concepts > > > > -- > > thanks > > --mac

[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, sen

Re: [algogeeks] Challenge

2011-08-20 Thread MAC
@Sanjay awesome aproach frd .. --mac On Sat, Aug 20, 2011 at 3:39 PM, Sanjay Rajpal 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

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 wrote: > @mac: just to clear my understanding, u need to print paths that sum up

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

2011-08-19 Thread MAC
. Any suggestion ??? --mac On Fri, Aug 19, 2011 at 1:20 PM, MAC wrote: > > can someone explain how to solve this: > > You are given a binary tree in which each node contains a value. Design an > algorithm to print all paths which sum up to that value. Note that it can be > any pat

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

2011-08-19 Thread MAC
came up and algo &¬ 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 algo

[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 are

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

2011-08-18 Thread MAC
minimize the difference. > > Thanks & Regards, > Anantha Krishnan > > > On Thu, Aug 18, 2011 at 1:01 PM, MAC 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

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

[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} >

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

2011-08-17 Thread MAC
email 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 po

[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, sen

Re: [algogeeks] array question

2011-08-16 Thread MAC
Tue, Aug 16, 2011 at 2:34 PM, sukran dhawan wrote: > >> what is the complexity in which it has been done ? >> >> On Tue, Aug 16, 2011 at 1:41 PM, MAC wrote: >> >>> >>> Given an array of integers. Each number in the array repeats ODD number >>&g

[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

Re: [algogeeks] sumitabha das unix ebook ?

2011-08-16 Thread MAC
ire.com/?ej74twjczauidil >> >> On Tue, Aug 16, 2011 at 9:57 AM, MAC wrote: >> >>> does anyone has sumitabha das unix ebook for unix ? >>> >>> -- >>> thanks >>> --mac >>> >>> -- >>> You received this me

[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] de shaw ? any link for questions ?

2011-08-14 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 g

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 wrote: > thanks guys .. so lets take the question we had "design a car rental > system" .. so the intervie

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

2011-08-12 Thread MAC
i do next --mac On Fri, Aug 12, 2011 at 1:11 PM, keyan karthi wrote: > First thing tat should come to your mind s ' requirements ' ask him > wat de requirements are. He will expect tat.. > > On 8/12/11, MAC wrote: > > Hi guys , > > > > Can anyone help m

[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

Re: [algogeeks] student and company match algo

2011-08-03 Thread MAC
any priorities 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

[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] Google Interview Question

2011-01-05 Thread MAC
send email to algoge...@googlegroups.com. > To unsubscribe from this group, send email 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 messag

[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 to

Re: [algogeeks] Re: Interview question amazon

2010-12-31 Thread MAC
>> In your 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 wrote: >> > you are given a bst where each node has a int value , parent pointer , >> and &g

[algogeeks] Interview question amazon

2010-12-26 Thread MAC
. 5 1 10 0 2 6 11 so to find 16 we say it is 1 to 5 to 10 -- thanks --mac -- You received this message because you are subscribed to the Google Groups

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

2010-12-24 Thread MAC
o go left .. till u find 5 or less than 5 hope this helps regards --mac On Sat, Dec 25, 2010 at 8:25 AM, yq Zhang 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 c

[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

[algogeeks] Re: amazon interview question

2010-12-24 Thread MAC
> 00011 > 0 > 1 > > 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 G

[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 algogeek

[algogeeks] matrix row column

2010-12-22 Thread MAC
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

[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, sen

[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

[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

Re: [algogeeks] Debugging questions

2010-11-13 Thread MAC
e have fun(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 wrote: > *1st programe give output:199 but 2nd give Segmentation fault why* onle > change in return &

[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

[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,

[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 algogeek

[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 algogeek

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 wrote: > Traverse the matrix in z-order, or hilbert-order. This is a heuristic- > algo. > > On Oct 4, 1:51 pm, mac adobe wrote: > > Given a b

[algogeeks] binary matrix

2010-10-04 Thread mac adobe
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, sen

Re: [algogeeks] repeating numbers in an array

2010-10-02 Thread mac adobe
w many times the element occurs and the list gives > the elements. > > > On Sun, Oct 3, 2010 at 11:22 AM, sharad kumar wrote: > >> it will take same amount of memory nakey value is element and vaule is >> the amount of times element occurs. >> >> >>

Re: [algogeeks] repeating numbers in an array

2010-10-02 Thread mac adobe
i think hash map takes lots of memory ... please correct me if i am wrong here .. anyways its a soluton but i would like to have a different solution .. :) --mac On Sun, Oct 3, 2010 at 10:55 AM, sharad kumar wrote: > cant u use a hash map buddy??? > > On Sun, Oct 3, 2010 at 10:3

[algogeeks] repeating numbers in an array

2010-10-02 Thread mac adobe
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...@googlegrou

Re: [algogeeks] Minimum ladders required

2010-10-01 Thread mac adobe
@ Yang .. can you please share book authors so that i can refer .. . Please share some insight also .. it will help me understand it. --mac On Fri, Oct 1, 2010 at 4:01 PM, mac adobe wrote: > correcting ... Its minimum numbers of ladders required > > > Please suggest how you th

Re: [algogeeks] Minimum ladders required

2010-10-01 Thread mac adobe
ladders your require . --mac On Fri, Oct 1, 2010 at 3:56 PM, Yan Wang wrote: > I think your question should be to find the minimum number of ladders > required. > > This is a very classic Greedy-Algorithm solved problem. Please refer > to Chapter 4 of book "Algorithm Design

[algogeeks] maximum ladders required

2010-10-01 Thread mac adobe
ladder should remain attached to the plane. So if plane lands at 3 am and fly at 3 pm , we need a ladder from 3 am to 3 pm dedicated for that plane. Given land_time and fly_time of multiple planes in a day , find the maximum number of ladders your require . --mac -- You received this message

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 wrote: > No parody .. that would be another doubt :( > > > On Sat, Sep 25

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

[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 al