Re: [algogeeks] Re: Generating mazes

2013-02-08 Thread Anup Ghatage
at 3:51 AM, Don dondod...@gmail.com wrote: I believe that this will generate a maze with multiple cycles, which violates the requirement stated in the initial question that the maze have exactly one solution. On Feb 6, 11:53 am, Anup Ghatage ghat...@gmail.com wrote: There is another algorithm

Re: [algogeeks] Re: Generating mazes

2013-02-06 Thread Anup Ghatage
. -- Anup Ghatage www.ghatage.com -- 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. For more options, visit https

Re: [algogeeks]

2011-12-05 Thread Anup Ghatage
/group/algogeeks?hl=en. -- Anup Ghatage -- 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] Finding frequent words

2011-11-29 Thread Anup Ghatage
://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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] Finding frequent words

2011-11-29 Thread Anup Ghatage
Ghatage ghat...@gmail.com wrote: Splay trees On Tue, Nov 29, 2011 at 10:07 PM, kumar raja rajkumar.cs...@gmail.comwrote: You get a stream of words, find top m frequent words. What are all the possible approaches for this problem ?? -- Regards Kumar Raja M.Tech(SIT) IIT Kharagpur, 10it60

Re: [algogeeks] Finding frequent words

2011-11-29 Thread Anup Ghatage
Correction: Upon the frequency of an element it's BROUGHT UP closer to the root. On Wed, Nov 30, 2011 at 6:39 AM, Anup Ghatage ghat...@gmail.com wrote: Splay Trees are self modifying trees. Upon the frequency of an element it's not is brought up closer to the root. So in a continuous stream

Re: [algogeeks] Interview question

2011-11-29 Thread Anup Ghatage
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. -- Anup Ghatage -- You received this message because you

Re: [algogeeks] Anagrams

2011-11-29 Thread Anup Ghatage
+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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: Finding the repeated element

2011-11-24 Thread Anup Ghatage
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. -- Anup Ghatage -- You

Re: [algogeeks] An Array Problem

2011-11-22 Thread Anup Ghatage
/group/algogeeks?hl=en. -- Anup Ghatage -- 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] An Array Problem

2011-11-22 Thread Anup Ghatage
) using binary search. Pop out all these elements and assign the value m in the output array. Elements remaining at the end will have the value 0. I am not sure about the complexity of this algorithm... On Wed, Nov 23, 2011 at 12:02 AM, Anup Ghatage ghat...@gmail.com wrote: I can't think

Re: [algogeeks] Amazon Onsite Chennai SDE

2011-11-14 Thread Anup Ghatage
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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

Re: [algogeeks] difference btw int *a[] and int (*a)[]

2011-11-13 Thread Anup Ghatage
. -- Anup Ghatage -- 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

Re: [algogeeks] Re: kth smallest element

2011-11-10 Thread Anup Ghatage
/group/algogeeks?hl=en. -- Anup Ghatage -- 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: Median of 2D matrix

2011-11-08 Thread Anup Ghatage
this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Median of 2D matrix

2011-11-02 Thread Anup Ghatage
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. -- Anup Ghatage -- You

Re: [algogeeks] Microsoft Question

2011-10-31 Thread Anup Ghatage
/group/algogeeks?hl=en. -- Anup Ghatage -- 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] Dp solution for this problem?

2011-10-30 Thread Anup Ghatage
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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] Re: Intersection of arrays

2011-10-28 Thread Anup Ghatage
, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] Searching In a large file

2011-10-27 Thread Anup Ghatage
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. -- Anup Ghatage -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Re: Questions

2011-10-27 Thread Anup Ghatage
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. -- Anup Ghatage -- You received this message because you

Re: [algogeeks] Re: Intersection of arrays

2011-10-27 Thread Anup Ghatage
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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: Array Problem??

2011-10-03 Thread Anup Ghatage
+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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

Re: [algogeeks] Google Interview Question

2011-10-01 Thread Anup Ghatage
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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

Re: [algogeeks] Amazon Interview Question

2011-09-23 Thread Anup Ghatage
/group/algogeeks?hl=en. -- Anup Ghatage -- 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]

2011-09-22 Thread Anup Ghatage
://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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] c output

2011-09-18 Thread Anup Ghatage
. 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. -- Anup Ghatage -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] Microsoft Question

2011-09-18 Thread Anup Ghatage
, 2011 at 8:30 AM, Anup Ghatage ghat...@gmail.com wrote: As WgpShashank once pointed out. Search the whole matrix for the first character instances, for each instance, send the array, string and that char's position to a function that will recursively check its direct neighbors for the next

Re: [algogeeks] DS QUESTION

2011-09-18 Thread Anup Ghatage
://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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] How one can measure time spent in context switch??

2011-09-17 Thread Anup Ghatage
. 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. -- Anup Ghatage -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] C++ Query...

2011-09-16 Thread Anup Ghatage
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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

[algogeeks] Find the output

2011-09-16 Thread Anup Ghatage
#includestdio.h int main() { int a[5]={1,2,3,4,5}; int *ptr=(a + 1); printf(%d %d\n,*(a+1),*(ptr-1)); return 0; } Find the output! -- 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] Re: no of elements of the array

2011-09-16 Thread Anup Ghatage
this group at http://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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] Find the output

2011-09-16 Thread Anup Ghatage
} a a a+1 a+1 a is address of whole array...so a+1 means next element after array completion. so ptr-1 will point to 5 ... On Fri, Sep 16, 2011 at 1:25 PM, Anup Ghatage ghat...@gmail.com wrote

Re: [algogeeks] Microsoft Question

2011-09-16 Thread Anup Ghatage
. 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. -- Anup Ghatage -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] OS

2011-09-14 Thread Anup Ghatage
://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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: Returning 0 with probability p and 1 with probability 1-p

2011-09-12 Thread Anup Ghatage
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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

Re: [algogeeks] Re: Questions --

2011-09-11 Thread Anup Ghatage
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. -- Anup Ghatage -- You received

Re: [algogeeks]

2011-09-09 Thread Anup Ghatage
at http://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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] EOF

2011-09-06 Thread Anup Ghatage
You can quite easily map this problem to that of a typical client-server protocol. You don't know the size of the data, and the all packets will be of a certain size, possibly, except the last one. So the solutions provided for that problem might apply to some cases of this! -- Anup Ghatage

Re: [algogeeks] MICROSOFT

2011-09-05 Thread Anup Ghatage
some size, and implements.. when we cross the assumed size,then it again gives some more memory so that all the operations are optimum (less collisions). On Sun, Sep 4, 2011 at 5:32 PM, Anup Ghatage ghat...@gmail.com wrote: Sid, I'm afraid a hash table won't help much. Given

Re: [algogeeks] very urgent .. help

2011-09-04 Thread Anup Ghatage
What is the purpose of this elitmus test? Does scoring good in it qualify you for something? -- 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

Re: [algogeeks] Tejas networks

2011-09-04 Thread Anup Ghatage
Could you please give an example for question 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

Re: [algogeeks] MICROSOFT

2011-09-04 Thread Anup Ghatage
Just a quick note to the above solution. If the tree is a binary search tree and you are going to put it in an array after an inorder traversal, the elements will be sorted, so to find the k'th max just access the n-k'th element -- You received this message because you are subscribed to the

Re: [algogeeks] MICROSOFT

2011-09-04 Thread Anup Ghatage
. So the algorithm would be O( m^2 log m ) just to populate the hash and find the frequencies. -- Anup Ghatage -- 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

Re: [algogeeks] c question

2011-09-03 Thread Anup Ghatage
See, a is defined in main() therefore its scope is limited to main(). It is stored probably in main()'s stack When you pass it to a function as a pointer. You don't make a copy of 'a' onto the function's stack. The only way you can view, manipulate it is using a pointer, and that pointer is your

Re: [algogeeks] arrays in c

2011-09-03 Thread Anup Ghatage
In other words, The original array identifer, and hence the pointer, is a constant pointer. -- 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

Re: [algogeeks] c question

2011-09-03 Thread Anup Ghatage
Isn't it obvious 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 options,

Re: [algogeeks] Book Request Data Structures and Algorithms Made Easy

2011-09-03 Thread Anup Ghatage
^ +1 -- 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

Re: [algogeeks] MICROSOFT

2011-09-03 Thread Anup Ghatage
Sort the given array first. : O(n logn) You'll have: {2,3,3,5,5,5} First parse all the elements in the array and identify the unique ones and store the count in N Now create a two dimensional array A[N][2]; Store the number in A[0][0] and store its frequency in A[0][1] etc. : O (n) Now, reverse

Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-03 Thread Anup Ghatage
I had once read somewhere that they had used gets() during the first compilations of unix, and it used to always crash for some test cases. So after that they stopped using it and alerted everyone of the problem.. -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Find the Max from each sub-array of size k

2011-09-02 Thread Anup Ghatage
I just checked Shashank's blog post. The Deque solution is awesome :) -- Anup Ghatage -- 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

[algogeeks] Find the Max from each sub-array of size k

2011-09-01 Thread Anup Ghatage
Given an unsorted Array A and any integer k where k = size of A Print the maximum of each sub-array of size k of A. eg: A = [ 3, 5, 1, 9, 0, 4, -1, 7 ] k = 4 Max: 9 9 9 9 7 -- Anup Ghatage -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] Re: Find square root a number

2011-08-30 Thread Anup Ghatage
Anyone interested in laying out the trade off's of the Babylonian method vs Newton Raphson? -- Anup Ghatage -- 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

Re: [algogeeks] Amazon written test ques

2011-08-30 Thread Anup Ghatage
So, in short, find all permutations for a given string and create a linked list from them? -- Anup Ghatage -- 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

Re: [algogeeks] C puzzle

2011-08-29 Thread Anup Ghatage
@Rajeev: I had written down the recursion tree on paper but since you said that there were 10 reds and greens, I compiled the code and checked it myself. I'm afraid you are wrong my friend. The correct answer is indeed 6 RED and 10 GREEN calls. -- Anup Ghatage -- You received this message

Re: [algogeeks] Re: There is an array and the distance between any two consequent elements is one(+1 or -1) and given a number. You have to check whether the number is in array or not with minimum com

2011-08-29 Thread Anup Ghatage
@tech Could you give an example for this? If I've understood the question correctly, if we are not allowed duplicates in the array the array turns out to be sorted. If we are allowed duplicates, do we return the first occurrence ? @Dave What would be the complexity of your solution? -- You

Re: [algogeeks] Re: There is an array and the distance between any two consequent elements is one(+1 or -1) and given a number. You have to check whether the number is in array or not with minimum com

2011-08-29 Thread Anup Ghatage
@Dave Your algo's average case working should be better than a naive O(n).. -- Anup Ghatage -- 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

Re: [algogeeks] convert a string into another in minimum number of steps

2011-08-29 Thread Anup Ghatage
Possibly a case of finding the longest common sub-sequence and then doing the insertions/deletions etc or AKA Levenshtein distance / Edit Distance -- Anup Ghatage -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

Re: [algogeeks] Re: puzzle

2011-08-26 Thread Anup Ghatage
Check this out: Tie it at the 200th meter mark. Throw the 150mt rope down. Climb down to the 100th meter pole. Tie the rope there from the middle, and not the end. So what you have is a 150 mt rope that is tied at 200 mt mark, 100 mt mark and 50 mts of the rope from 100 mt marks is hanging.

Re: [algogeeks] Re: Remove all Duplicates Words

2011-08-25 Thread Anup Ghatage
Actually, this method will be O(n) for any number of occurrences of a single word, but It will go into O(n^2) for multiple occurrences of multiple words. -- 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] Re: Citrix C Question

2011-08-25 Thread Anup Ghatage
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. -- Anup Ghatage -- You received this message

Re: [algogeeks] Suggestion

2011-08-25 Thread Anup Ghatage
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Anup Ghatage -- 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] finding string in matrix grid

2011-08-25 Thread Anup Ghatage
Hey, Tell me if this assumption of the problem statement is correct.. String: ram Matrix: |r | a b |a | g h |m| j d This is vertical and similar for its horizontal counter part... So the logic is more than obvious, For vertical (and horizontal), do a sub-string search column-wise and

Re: [algogeeks] vertical sum

2011-08-25 Thread Anup Ghatage
. 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. -- Anup Ghatage -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] vertical sum

2011-08-25 Thread Anup Ghatage
On Thu, Aug 25, 2011 at 8:06 PM, Shravan Kumar shrava...@gmail.com wrote: @Anup Can you please elaborate why it will not work? On Thu, Aug 25, 2011 at 8:02 PM, Anup Ghatage ghat...@gmail.com wrote: Naren: It wont work for tree's of level 3 and non-complete binary trees On Thu, Aug 25

Re: [algogeeks] C Trick

2011-08-24 Thread Anup Ghatage
@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. -- Anup Ghatage -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] C Trick

2011-08-24 Thread Anup Ghatage
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. -- Anup Ghatage -- You received

Re: Re: [algogeeks] Re: Remove all Duplicates Words

2011-08-24 Thread ghatage
@Ankur Garg: Please explain to me how my method uses extra memory? -- 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