Given a string of characters and operations: move the substring from position to to the beginning. Constraints: . Regular arrays would require per operation. With implicit treaps, each operation is :
Split to extract
Merge the extracted piece at the front Before reading the solution, think about how you'd implement this with three splits and two merges.