Hi everyone,↵
I am trying to find all permutations of the input elements which will result in the same Binary Search tree as the one formed with the input array.↵
↵
Eg: ↵
I/P: 4, 3, 1, 2, 6, 5, 7 ↵
↵
o/p:4 , 6, 3, 7, 5, 1, 2 ↵
↵
4, 3, 2, 1, 6, 5, 7 ↵
↵
and so on.↵
↵
I have gone through links on internet but could not code it.↵
↵
**I am unable to print all the permutations correctly. So, I request community to help me with logic ( if recurive function can be provided too )?** ↵
↵
Thank You
I am trying to find all permutations of the input elements which will result in the same Binary Search tree as the one formed with the input array.↵
↵
Eg: ↵
I/P: 4, 3, 1, 2, 6, 5, 7 ↵
↵
o/p:4 , 6, 3, 7, 5, 1, 2 ↵
↵
4, 3, 2, 1, 6, 5, 7 ↵
↵
and so on.↵
↵
I have gone through links on internet but could not code it.↵
↵
**I am unable to print all the permutations correctly. So, I request community to help me with logic ( if recurive function can be provided too )?** ↵
↵
Thank You