B2.4 Programming algorithmsB2.4.3

Bubble Sort and Selection Sort

Construct and trace algorithms to implement bubble sort and selection sort, evaluating their time and space complexities

SL + HL≈ 65 minCommand term: ConstructPremium

In this lesson

  • Constructing bubble sort and selection sort in Java and Python
  • Tracing both sorts pass by pass
  • Stating their time and space complexities
  • Evaluating which sort suits different data sets

This lesson is part of Premium

Every topic has one free lesson. Premium unlocks every interactive lesson, the exam-style questions at the end of each one, and the rest of Praxis IB.

What's inside

  1. LearnTwo simple sorts
  2. CodeBubble sort
  3. CodeSelection sort
  4. LabSort step by step
  5. CheckTrace a bubble sort
  6. CodeStopping early
  7. LearnTime and space complexity
  8. CheckWhich sort?
  9. CheckQuick check
  10. ExamWorked exam answer
  11. ReviewMistakes examiners see
  12. Exam practiceExam-style questions

Ends with 4 exam-style questions worth 17 marks, with a self-marking markscheme.