How can binary search tree be printed in form of table? In db exist a table representation of data and other data rapresentation as binary search tree. If I insert some data from array 3 row * 5 column = 15 elements, I want print from binary search tree rows,columns basically cells of table. How can I get this goal?
In language C I have a matrix create thus: cell[0][0] = 0 cell[0][1] = 1 cell[0][2] = 2 cell[0][3] = 3 cell[0][4] = 4 cell[1][0] = 0 cell[1][1] = 1 cell[1][2] = 2 cell[1][3] = 3 cell[1][4] = 4 I insert 0 - 1 - 2 - 3 - 4 of each row in binary search tree, My problem is how can visit binary search tree in this order: 0 1 2 3 4 0 1 2 3 4? because the visit of binary search tree print node in key order. If I visit in pre order I get these nodes: 0 0 1 1 2 2 3 3 4 4. binary search tree (bst): https://www.cs.usfca.edu/~galles/visualization/BST.html https://zabicareer.000webhostapp.com/images/bst.png