In this example, we prove that when we sort

[3,[2,[1,[]]]]

we get

[1, [2, [3, []]]]

First, we use the "Sort Begin Property" to initialize the "sorted list" to [ ]. Then we begin popping maximum values from the original list and pushing them into the "sorted list."

First, we pop 3 at index 0 and push it into the "sorted list." Step 9 shows that the remainig elements are now [2, [1, []]] and the "sorted list" is [3, []].

Then we pop 2 at index 0. Step 18 shows that the remainig elements are now [1, []] and the "sorted list" is [2, [3, []]].

Finally, we pop 1 at index 0. Step 25 shows that the remainig elements are now [ ] and the "sorted list" is [1, [2, [3, []]]].

Since the remaining list is now empty, the "sorted list" is the final result of the sorting operation.

Quiz (1 point)

Prove that:
result of sorting [ 3, [ 2, [ 1, [ ] ] ] ] = [ 1, [ 2, [ 3, [ ] ] ] ]

The following properties may be helpful:

Please write your proof in the table below. Each row should contain one claim. The last claim is the statement that you are trying to prove.

Step Claim Reason (optional) Error Message (if any)
1
2
3
4
5
6
7
8
9
10

Become a subscriber to save your progress, see the correct answer, and more!