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

October 21, 2017, 01:15:40 AM
: 1
: Number of Trees  ( 1336 )
« : 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>>



Latest
Random



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