Hard Interview Problem

Правка en1, от Romok007, 2019-11-21 19:22:51

Hi Everyone, I am stuck in an interview problem and not finding any resources on the internet which can help me find a solution, if you provide an idea about the solution it will be of great help. The problem is as follows :

Generate a random binary search of 'n' nodes with equal probability.

For example : if n = 3 there are 5 possible binary search trees, our program should return any one tree with equal probability (i.e. 1/5).

Теги #help, #interviews, #trees

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Romok007 2019-11-22 10:00:48 5 Tiny change: 'ry search of 'n' no' -> 'ry search tree of 'n' no'
en1 Английский Romok007 2019-11-21 19:22:51 472 Initial revision (published)