AITeky Learn

AiTeky Original Interactive Learning & Practice Beginner

Searching and sorting: binary search, sorting costs and the lookup that scanned everything

Count the steps of a linear scan against binary search, see why sorting first pays off only when you search many times, and fix a slow lookup in a list of orders by choosing between a scan, a sort and an index.

Most programs spend their time looking for things: a customer, a price, an order. How long that takes depends on how the data is arranged. This course counts steps in small Python programs that run in your browser, so you can see the cost of a scan, the saving from binary search, and the price of sorting first.

  • Learn lessons explain one idea at a time and let you run it.
  • Industry ready lessons decide and justify, and end with interview questions.

The data is made up. Basic Python helps.

Locked. Sign up free

Learn

Understand each idea with everyday examples. No coding background needed.

  1. 01 25 min Free sample 🔒 AiTeky Pass Scan versus binary search Count the comparisons a linear scan and a binary search need on a sorted list, and see why halving the search range makes a million items cost about twenty steps.
  2. 02 25 min 🔒 AiTeky Pass Is sorting first worth it? Count the work of sorting once and then searching many times, find the break-even point against repeated scans, and see why a one-off search should just scan.

Industry ready

Real problems from real jobs, and the questions interviewers ask about them.

  1. 03 30 min 🔒 AiTeky Pass On the job: the lookup that scanned everything An order-status page slows down as the order list grows because every request scans the whole list. Compare four fixes by work per request, effort and risk, choose one, and write the change note.

We use essential cookies to run the site. With your permission we also set one anonymous ID to count unique visitors, and analytics cookies to see which pages help learners. Cookie notice

Join AiTeky Learn. It's free.

Create a free account to track your progress, save items for later and get study suggestions.

Sign up free Log in