Want to keep learning?

This content is taken from the Raspberry Pi Foundation & National Centre for Computing Education's online course, Programming 102: Think Like a Computer Scientist. Join the course to learn more.

Examples of bubble sorts from the web

There are pleanty of interactive bubble sort demonstrations available on the web. Before you go ahead and program your own bubble sort algorithm, have a look at one of the web pages below.

While playing with the visualisations, ask yourself some of the following questions.

How well does the bubble sort algorithm work when sorting a list that is:

  • Randomly ordered?
  • Sorted, but from highest to lowest?
  • Nearly sorted (just one item out of place)?
  • Already sorted?

Discuss your findings in the comments.

Share this article:

This article is from the free online course:

Programming 102: Think Like a Computer Scientist

Raspberry Pi Foundation