Re: [algogeeks] Amazon Interview Question
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 http://groups.google.com/group/algogeeks?hl=en. -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- regards, Gaurav Aggarwal -- 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 this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] 5th largest element
@subramania jeeva i think the your algorithm will have O(n^2) worst case when the list is sorted.. On Mon, Jun 6, 2011 at 7:22 PM, subramania jeeva subramaniaje...@gmail.comwrote: Tree formation will also take O(nlgn).. For inserting each node It'll take O(lgn).. so for inserting n nodes It'll take O(nlgn) time..:) Cheers ~ Jeeva ~ -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- Gaurav Aggarwal SCJP -- 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 this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] 5th largest element
Thanks subramania.. It is very nice explanation.. [?] On Mon, Jun 6, 2011 at 8:33 PM, subramania jeeva subramaniaje...@gmail.comwrote: @Gaurav Aggarwal Obviously O(n^2) worst case if we use ordinary quick sort with slight modification(Best case O(n))... But quick sort can also be done by taking median as element for partition instead of taking first or last element which will take O(nlgn) worst case complexity... But to do the given problem median of median algorithm is best.. It will take O(n) in worst case... 1. Divide the n elements of input into n/5 groups 2. Find median of each group by insertion sort(performs well for small inputs) and pick the median for each each group. 3. Repeat steps (1) and (2) repeatedly to find a single median 4.partition the array using that median. such that k elements are in lower partition and n-k elements are in higher side of partition.(use the partition insuch a way that smallest elements are on higher side of partition and largest elements are on lower side of partition) 5. If index i==k(ith largest element) then return a[i].. else recurse steps 1 to 5 such that (if ik then use k to r) (else use p to k)(p is the starting index and r is ending index).. I hope It explains the code given by piyush sinha.. Cheers ~ Jeeva ~ -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- Gaurav Aggarwal SCJP -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. 328.png
Re: [algogeeks] remove duplicate chars in a string without using extra memory
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 http://groups.google.com/group/algogeeks?hl=en. -- -Aakash Johari (IIIT Allahabad) -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- Lalit Kishore Sharma, IIIT Allahabad (Amethi Capmus), 6th Sem. -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- -Aakash Johari (IIIT Allahabad) -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- Gaurav Aggarwal SCJP -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. 33D.gif
Re: [algogeeks] Re: Request for books
and if you rather buy these books instead of asking for pirated copies then isn't that would be best?? On Sun, Jun 5, 2011 at 8:09 PM, Ankit Sablok ankitsablok19091...@gmail.comwrote: also if one can mail me all the versions of sedgewick I will b grateful On Jun 5, 6:40 pm, Ankit Sablok ankitsablok19091...@gmail.com wrote: If some one has the following books Algorithms and Data structures in C - Mark Allen Weiss Network Flow Algorithms - by Ahuja please mail it to ankitsablok19091...@gmail.com thanxx 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 algogeeks@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. -- Gaurav Aggarwal SCJP -- 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 this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] MS Question
other solution might be to use doubly linked list, even if one pointer gets corrupt, there is other path to reach the destination. On Wed, Jun 1, 2011 at 1:24 PM, Ashish Goel ashg...@gmail.com wrote: given a single linked list, there is a possibility of pointer corruption, modify the data structure to ensure that the data is not lost. in my view a skip list is a good option, any other solutions? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- Gaurav Aggarwal SCJP -- 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 this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Are you looking for Argo Sales Service Developer for remote
Its enough.. dont we have some moderator looking at this group?? Posting jobs on a group where we discuss about algorithm is a spam.. Moderator please block these kind of mails.. On Tue, May 24, 2011 at 7:23 PM, sohail.panzer8 sohail.panz...@gmail.comwrote: Hello, Hope you are doing well. I am a technical recruiter with Panzer Solutions LLC Software Implementing and IT consulting company located in CT. Please go through the Job Description and send me your updated resume with contact information. *Please reply at soh...@panzersolutions.com * Title : Argo Sales Service Developer Location : Remote Duration : 12-18 Months contract The candidate will need to come to Cincinnati for the 1st 3 weeks to get caught up. Must: Argo Sales Service install/implementation experience (years doesn’t matter) Experience doing a SRS document (Software Requirements Specifications) Understanding of Enablers Worked for a bank using this tool. Design, code and test Plus: Sales and service cert- the 12 day training program. Responsibility Work their SRS, provide updates, work with the Architects, code, check for unit defects from coding, pass code review. Done and Done. Thank you, Sohail Khan | Technical Recruiter Panzer Solutions LLc 45 Stuart Ave, K Norwalk, CT 06850 USA Voice: 203-813-2052 soh...@panzersolutions.com URL: www.panzersolutions.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 this group at http://groups.google.com/group/algogeeks?hl=en. -- Gaurav Aggarwal SCJP -- 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 this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: If any one have algorithms for interviews by adnan aziz ebook... Please mail ...
To ADMIN / MODERATOR: please delete this thread.. these mails are really irritating.. On Thu, May 12, 2011 at 2:11 PM, inderpal singh inderpal...@gmail.comwrote: me too pls inderpal...@gmail.com On Mon, May 9, 2011 at 12:07 AM, vamsi achyuth vamsiachy...@gmail.comwrote: mail tome plz vamsiachy...@gmail.com On 8 May 2011 22:00, UTKARSH SRIVASTAV usrivastav...@gmail.com wrote: mail me also usrivastav...@gmail.com On Sun, May 8, 2011 at 1:08 AM, ArPiT BhAtNaGaR arpitbhatnagarm...@gmail.com wrote: dere is soln first person mail to first person on list n den the one who gets to next so since we all need it :P On Fri, May 6, 2011 at 11:01 AM, vamsi achyuth vamsiachy...@gmail.comwrote: mail me++; On 6 May 2011 10:52, naresh kumar naresh.sac...@gmail.com wrote: Pleas mail to me also... naresh.sac...@gmail.com Thanks in advance On Fri, May 6, 2011 at 1:46 AM, Ashish Modi ashishrmod...@gmail.comwrote: Hello, Can you please mail me ashishrmod...@gmail.com Thanks in advance -- With Regards Ashish -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- Thanks Regards Arpit Bhatnagar (Computer Engineering) (MNIT JAIPUR) -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- *UTKARSH SRIVASTAV CSE-3 B-Tech 2nd Year @MNNIT ALLAHABAD* -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- Gaurav Aggarwal SCJP -- 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 this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks]
SPAM.. moderator please delete this post.. On Thu, May 12, 2011 at 7:00 PM, SANDEEP CHUGH sandeep.aa...@gmail.comwrote: http://www.PaisaLive.com/register.asp?3176949-6719896http://www.paisalive.com/register.asp?3176949-6719896 CHECK 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...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Gaurav Aggarwal SCJP -- 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 this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: partitioning the array
yes we would use 2 dimensional array to store the values inbetween but the main question here is that is the reccurence realation correct?? On Mon, May 9, 2011 at 11:31 AM, anshu anshumishra6...@gmail.com wrote: @gaurav both things are same, matrix is a simple and efficient way to do problem like 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...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Gaurav Aggarwal SCJP -- 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 this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: partitioning the array
@anshu then shall we use the foll reccurence realation?? 1i=n S=(s+1)/2 f(i,S)= min( f(i-1, S), f(i-1, S- ar[i]) ) On Mon, May 9, 2011 at 10:42 AM, anshu anshumishra6...@gmail.com wrote: Use KnapSack DP. suppose the sum of element = s and number of elements = n make a 2-dimesnsional array of size n * ((s+1)/2); I think that much hint is enough. if we think little bit more we can optimize it also. -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- Gaurav Aggarwal SCJP -- 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 this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Extract Top K elements from a List of N elements based on frequency
It can be done without sorting. Take the first element as pivot element. Calculate its position using Partition algorithm. If its new index is K, then on left side are top K integers. If indexK, apply algo on left side Else apply algo on right side. Best Case: O(1) Worst Case: O(n^2) But there are very less chances of worst case. It is when the list is already sorted. On Thu, May 5, 2011 at 1:06 AM, amit amitjaspal...@gmail.com wrote: Hi , We are give a list of integers now our task is to find the top K integers in the list based on frequency. Apart from sorting the data can there be any other algorithm? -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- Gaurav Aggarwal SCJP -- 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 this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Extract Top K elements from a List of N elements based on frequency
ok, i got it.. ya i misunderstood it.. On Sat, May 7, 2011 at 11:03 PM, Dave dave_and_da...@juno.com wrote: @Gaurav: As I understand your solution, you are finding the K largest integers based on value, rather than the K with the highest frequency of occurrence. @Amit: Hash the integers into a hash table that includes a field for the frequency count. When a new entry is made, set the frequency count to 1. When an integer already is in the table, increment its count. After all integers are processed, compress out the unused hash table entries and find the Kth largest element. The overall algorithm can be done in O(n). Dave On May 7, 12:06 pm, Gaurav Aggarwal 0007gau...@gmail.com wrote: It can be done without sorting. Take the first element as pivot element. Calculate its position using Partition algorithm. If its new index is K, then on left side are top K integers. If indexK, apply algo on left side Else apply algo on right side. Best Case: O(1) Worst Case: O(n^2) But there are very less chances of worst case. It is when the list is already sorted. On Thu, May 5, 2011 at 1:06 AM, amit amitjaspal...@gmail.com wrote: Hi , We are give a list of integers now our task is to find the top K integers in the list based on frequency. Apart from sorting the data can there be any other algorithm? -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- Gaurav Aggarwal SCJP- Hide quoted text - - Show quoted text - -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- Gaurav Aggarwal SCJP -- 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 this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] partitioning the array
other approach is: 1. Add 0 to the array if it is odd 2. Sort the array 3. Now swap the second element and second last element. 4. In this way keep swapping every second element from front with every second element from back. 5. Stop when front pointer is greater than back. 6. Sum the first half and second half. Time Complexity: O(nlogn) No extra space needed. On Sun, May 8, 2011 at 8:53 AM, MANNU manishkr2...@gmail.com wrote: Steps to follow: 1.Sort the given array. 2.Partition each consecutive element in 2 arrays i.e. if 1st element is in 1st array then second will be 2nd array and 3rd in 1st. But for equal no. of elements you have to check for no. of elements in the array. If they are odd either insert a dummy elemnt of value 0 else output an error message (whatever you feel better). -- 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 this group at http://groups.google.com/group/algogeeks?hl=en. -- Gaurav Aggarwal SCJP -- 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 this group at http://groups.google.com/group/algogeeks?hl=en.