CHAPTER 4 · 2 lessons · 26 exercises

Data structures and algorithms

How an array differs from a list, trees, searching and sorting, and how much work each one takes.

Using arrays in phase 1 and turning them with loops leads here. The point is that two ways of writing the same thing can differ in speed by orders of magnitude.

It covers arrays, lists, stacks, queues and trees, linear search and binary search, the well-known sorting algorithms, and the idea of computational complexity. You come out able to tell whether ten times the data means ten times the time or a hundred times.

Lessons in this chapter

Data structures

  1. 09Ways of laying data outWhat is different between an array you have been pushing to and a list. Straight there by index, or walked to. The shapes data comes in: stack, queue, tree and hash table.Go to the exercises

Searching, sorting and how much work it takes

  1. 10Ways of searching and sortingTwo ways of writing the same answer can differ by orders of magnitude once the data grows. The shapes of searching and sorting, the order notation for how effort grows, and recursion.Go to the exercises

Next up is “The OS and software”. What the operating system is doing behind the scenes while your program runs.