Lists in action

See what changes in a Python list and a linked list.

Python list

Linked list

The same nodes stay connected. Only their values change.

Compared pairFinished positions

Both take O(n²) time. Links do not make bubble sort faster.

Python code


          

This is the slide algorithm: it keeps making passes even if the values are already sorted.