Cartesian Tree Adaptive Sort
Sort by building a Cartesian tree that captures local order, then extracting elements in sorted order.
4 notes
Sort by building a Cartesian tree that captures local order, then extracting elements in sorted order.
Maintain a sorted sequence by inserting elements into a binary search tree as they arrive and extracting them in order.
Sort by building a Cartesian tree and extracting elements via inorder traversal.
Insert all elements into a binary search tree, then traverse the tree in sorted order.