CodingLevel 2
Searching and sorting
Easynot started
Mediumnot started
Hardnot started
Sorting algorithmsOrganizing data allows us to find things faster, but there is no one-size-fits-all approach.3 minGreedy algorithmsMake the best local choice right now, without ever looking back.3 minBinary searchFind a needle in a sorted haystack by repeatedly cutting the search space in half.3 minHeaps & priority queuesAlways keep the largest (or smallest) element at the top, perfectly ready to grab.3 minIntervals & sweep lineProcess overlapping ranges by breaking them down into start and end events.3 minTwo pointersEliminate entire blocks of possibilities at once by converging from both ends.3 minAccept-Language content negotiationThe browser whispers its language preferences, ranked; the server reads the list top to bottom and serves the first one it can actually speak.4 minQuery top nKeep only the best few you've seen so far, and let the weakest of them guard the door.4 minSqueezing sorted keys that share prefixesWhen neighbours in a sorted list start the same way, stop repeating the part they already agree on.3 min