Here is a sorted row of numbers, and a question. Which two of them add to sixteen? The obvious answer is two nested loops, checking every pair. That is order n squared. There is a…
Included with a plan
This video is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.
Or start free: a free account opens lessons 2 and 3 of every track.
Chapters
Two pointers: one pass instead of two loops. Here is a sorted row of numbers, and a question. Which two of them add to sixteen? The obvious answer is two nested loops, checking every pair. That is order n squared. There is a
See also
Saved in this browser, and to your account when you sign in.