Index

Module 08 · DSAWorked problems, in English

Clinic #33: Koko Eating Bananas

Pattern: Binary search on the answer · LC 875

Sorting aur Searching
Sorting aur Searching · Open board

Is the Hinglish foundations board for sorting and searching. Its fifth panel is this clinic in one picture: a row of candidate speeds, crosses on the slow ones, ticks on the fast ones, and one border between them that binary search finds.

Before you start. Sorting & Searching showed binary search on a sorted list: look at the middle item, throw away the half that cannot hold what you want, repeat, so a million items takes about twenty looks instead of a million. Everything in this clinic is that same move, with one change: the sorted list you search is not in the input at all.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Lab

Merge sort is O(n log n) and insertion sort is O(n squared). On the list you actually have, which does less work?

Open Already in order, then Exactly backwards, and watch which sort is named under Cheapest sort on this list.

Open Sorting aur searching →

Review DSA →

Saved in this browser, and to your account when you sign in.