Re: [algogeeks] Answer This

2010-12-16 Thread vamsee marpu
Ans : Total 20 green-eyed people were there in the village.

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



Re: [algogeeks] valid paranthesis

2010-12-08 Thread vamsee marpu
Hi,



You can use Recursion logic of Catalan Numbers.





M. Vamsee

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



[algogeeks] BST to Double Linked List Without Using Extra Space

2010-11-24 Thread vamsee marpu
Hi,


 Can anybody help me in solving the following problem:


Convert a binary search tree in to a doubly linked list in level order
without using extra space :


BST
   1
  /  \
 2   3
/  \ /  \
  4  5 6  7

in to double linked list as:  1==2==3==4==5==6==7


I can do it using level order traversal using a queue, but the problem says
no extra space should be used, I tried a lot but can't able to figure out.



Thanks,
M. Vamsee

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



Re: [algogeeks] Mathematics Puzzle

2010-11-22 Thread vamsee marpu
@Ashim : Yes


@Shiv Shankar : The Question says : *the students arrange themselves in
random order in the queue.

   *69* *is possible only when the students arrange
themselves in decreasing order of their rank.

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



[algogeeks] Mathematics Puzzle

2010-11-21 Thread vamsee marpu
Does anybody know the solution for the following problem :


*A headmaster of a primary school performs an activity with the students of
a class to encourage them to perform better in academics. He asks them to
stand in queue, starts calling the students out one by one and asks them
their rank in class. Each one has a unique rank in class. If the rank of a
student is better than his/her previous best rank, then he awards him/ her a
lollipop (students love lollipops). Note that the first one in the queue
will always get a lollipop and the students arrange themselves in random
order in the queue. What is the expected number of lollipops the headmaster
will have to distribute among students if the total number of students in
the class is 69? Note that the answer can be a fractional number.*





Thanks and Regards,
M. Vamsee

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