GitXplorerGitXplorer
c

Number-of-Comparisions-in-generating-BST

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Verified
7bfd09e8ef3bc8a158bd0885d2208232533dd2d4

Add files via upload

ccozek committed 6 years ago
Verified
e1ffbcd6f004eff9ba0a74bb86aa01ec8d35ee33

Update README.md

ccozek committed 6 years ago
Verified
9d3a24d4bfa95be8c451d75df23bd68abbabc27b

Initial commit

ccozek committed 6 years ago

README

The README file for this repository.

Number-of-Comparisions-in-generating-BST

Take a positive integer (say K) as an input from the user. Generate all the K! BST from numbers {1,2,…,K}. For each generated BST, calculate the number of comparisons between the numbers required to generate that particular BST.

Sample Input/Output:

Enter a positive integer K = 3
Total number of generated BST = 6
Number of comparisons required to generate BST from permutations <1,2,3> = 3
Number of comparisons required to generate BST from permutations <1,3,2> = 3
Number of comparisons required to generate BST from permutations <2,1,3> = 2
Number of comparisons required to generate BST from permutations <2,3,1> = 2
Number of comparisons required to generate BST from permutations <3,1,2> = 3
Number of comparisons required to generate BST from permutations <3,2,1> = 3