Welcome,
%1$s
. Please
login
or
register
.
August 16, 2017, 07:04:57 PM
Submit
Quotes
CELL TRACKER
Online Fun Database

Interview Questions

C Questions

Number of Trees
Random
Celebrities
Places
Humour
Quotes
Informative
Articles
Stories
Indian
Videos
Puzzles
Easy
Medium
Tough
On Maths and Physics
What am I?
Puzzled PJs
« previous
next »
:
1
: Number of Trees ( 1308 )
Number of Trees
«
:
January 18, 2008, 05:47:56 PM From
thequark
»
Number of Trees
This is more of an algorithms and mathematics question.
Given a positive number N, calculate the number of binary search trees which will have N nodes in them.
The count is on the basis that two trees are considered equal if their _structure_ is same (Each node has the same number of left and right tree). So the data in the nodes doesn't matter.
The best approach would be to find out a mathematical formula for the same, yet this can be achieved by recursion also.
Liked It? Share it!
Tweet
:
1
« previous
next »
Best Rated
List All>>
Latest
Random
Loading...