I am a new computer engineering student. I want to create different sequences of nodes which give rise ro the same binary search trees.
For Example;
5
/ \
4 7
/ / \
1 6 10
the outputs will be
5,4,1,7,6,10
5,4,7,6,10,1
5,7,6,10,4,1
etc. (I took the sample from a post)
I want to create it in c, but I can't figure it out.I can do the formula giving the total number of sequences that should occur.
Total Formula; [numberOfLeftChild * numberOfRightChild * Combination(numberOfAllNodes-1,numberOfLeftNodes)]
I read these post. Given a BST and its root, print all sequences of nodes which give rise to the same bst
Count number of unique node sequences producing the same BST
Find number of permutations of a given sequence of integers which yield the same binary search tree
How many level order BST sequences are possible given a preOrder and inOrder sequence?
I will be grateful if you could help me.