Week 108 of 145 · TAOCP Vol 3: Sorting and Searching

TAOCP 6.1 Sequential Searching

2 tasks, 4 steps. Open a task's steps to see exactly what to do; each guide has the detail.

Sign up or sign in to tick these off and give this week a due date.

By the end of this week you can

  • Implement sequential search with a sentinel and measure the saving.
  • Compute expected search cost when keys have known access probabilities.
  • Explain how self-organizing lists adapt to skewed access patterns.

Week 108 · Self-check

Three quick questions

Ungraded, and it never holds anything up. Pick an answer to see why.

  1. What does placing the search key as a sentinel at the end of the table save?
  2. Keys have access probabilities 0.5, 0.3 and 0.2. Stored best first, what is the expected number of comparisons?
  3. A successful sequential search on 99 equally likely keys makes how many comparisons on average?

Nothing is saved while signed out.

Discussion

0 posts

Stuck on week 108, or finished early? Say what you tried and what happened. Hints over answers: full solutions go in a spoiler.

No posts yet. Ask a question or share a tip.

Sign in to postAnyone can read. Posting needs an account with a confirmed email.

Spot a mistake? Report it