I need a code of c++ binary search tree with strings thatcontains values.
for example
BST.insert(1,”a”)
BST.insert(3,”b”)
BST.insert(2,”c”)
and if I print using BST.inorder(), it should gives me
1,a
2,c
3,b
(a corresponds to 1, b corresponds to 3, c corresponds to 2)
Basically I need to print both strings and values but the orderdepends on integer values ( also have to do postorder,preorder)
I really don’t know how to do with strings.
(I prefer to use class)
Expert Answer
An answer will be send to you shortly. . . . .