Tree sort is a sorting algorithm that is based on Binary Search Tree data structure. It first creates a binary search tree from the elements of the input list or array and then performs an in-order traversal on the created binary search tree to get the elements in sorted order.
Algorithm:
Step 1: Take the elements input in an array. Step 2: Create a Binary search tree by inserting data items from the array into the binary searh tree. Step 3: Perform in-order traversal on the tree to get the elements in sorted order.
Read full article from Tree Sort - GeeksforGeeks
No comments:
Post a Comment