← DSA Foundations lessons

DSA Foundations final project

What earns the certificate?

Submit a page that shows which values binary search inspected. The checker follows your search and checks every visit.

  1. Use one .html or .htm file up to 256 KB. Give it a page title, a visible heading, and a paragraph describing your search.
  2. In a <pre> block, put at least three distinct integers in increasing order on the Sorted: line. Put one integer on the Target: line.
  3. On Visits:, list each middle value you inspected, separated by commas. When two positions share the middle, choose the left one. Choose a search that takes at least two comparisons. Stop at a match or an empty range.

A passing example

Sorted: 4, 9, 13, 18, 24, 31
Target: 18
Visits: 13, 24, 18

Start at 13. The target is higher, so keep 18, 24 and 31. Their middle is 24. Move left to 18 and stop.

See the complete HTML file
<!doctype html>
<html lang="en">
<head><meta charset="utf-8"><title>Searching the shelf</title></head>
<body>
  <h1>Searching the shelf</h1>
  <p>I used binary search to find book 18 on a sorted shelf.</p>
  <pre>Sorted: 4, 9, 13, 18, 24, 31
Target: 18
Visits: 13, 24, 18</pre>
</body>
</html>

Choose your own numbers, fill in the template and open the file in your browser. Submit the finished file from your account.

Checking your account…