Programming Algorithms Question:

How to find median of a BST?

Programming Algorithms Interview Question
Programming Algorithms Interview Question

Answer:

Find the no. of elements on the left side.
If it is n-1 the root is the median.
If it is more than n-1, then it has already been found in the left subtree.
Else it should be in the right subtree.


Previous QuestionNext Question
Define string in an algorithmic notation and an example to support it?What are the arguments present in pattern matching algorithms?