(arr)
| 28 | inorder(root.right,res) |
| 29 | |
| 30 | def treesort(arr): |
| 31 | # Build BST |
| 32 | if len(arr) == 0: |
| 33 | return arr |
| 34 | root = node(arr[0]) |
| 35 | for i in range(1,len(arr)): |
| 36 | root.insert(arr[i]) |
| 37 | # Traverse BST in order. |
| 38 | res = [] |
| 39 | inorder(root,res) |
| 40 | return res |