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
.
--
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
/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
://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
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
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
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
+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
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
/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
) 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
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
.
--
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
/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
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
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
/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
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 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
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
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
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
+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
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
/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
://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
.
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
, 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
://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
.
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
...@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
#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
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
}
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
.
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
://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
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
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
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
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
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
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
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
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
.
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
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
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
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,
^ +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
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
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
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
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
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
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
@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
@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
@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
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
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.
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
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
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
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
.
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
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
@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
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
@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
69 matches
Mail list logo