Study
CSC-301 route
Unit 5 · Lesson 2 of 4 13 min

Elementary Sorts — Bubble, Selection and Insertion

Three O(n²) sorts, three different costs inside the class — and the one you will actually use.

What this unit covers

Unit 5: Searching, Sorting and Graphs

  1. 1 Linear, Binary and Jump SearchBinary search is not "faster". It is faster only when the data is sorted — and sorting costs more than the search saves if you search once. · 14 min
  2. 2 Elementary Sorts — Bubble, Selection and InsertionThree O(n²) sorts, three different costs inside the class — and the one you will actually use. · 13 min
  3. 3 Merge Sort, Quick Sort, Bucket and Radix SortMerge sort and quicksort both split the problem, and they divide the work between themselves. · 15 min
  4. 4 Graphs — Representations, BFS and DFSA graph is the shape of any relationship that is not a chain and not a tree: roads, friendships, the web. · 15 min