Welcome, %1$s. Please login or register.

February 26, 2018, 07:27:53 AM
: 1
: Number of Trees  ( 1383 )
« : 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!


: 1
« previous next »


Best RatedList All>>


SMF 2.0.10 | SMF © 2015, Simple Machines | Contact Webmaster | OnlineFunDb.com © 2009/10 | Legal Disclaimer