#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
#columns:Front	Back	Tags
TAOCP §6.1 Sequential Searching: what does it cover?	Searching a list one item at a time, with tricks like sentinels to speed up the loop, and self-organizing lists that move frequently accessed items toward the front.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::about
TAOCP §6.1: why does it matter?	For small arrays, linear search beats fancier structures. The sentinel trick and move-to-front heuristic are still used in real code.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::why
TAOCP §6.1: what traps should you watch for?	<ul><li>Forgetting to restore the sentinel slot.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::traps
TAOCP §6.1, exercise 2 (rated 15): what is it asking?	Restate sequential search for a linked list.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise
TAOCP §6.1, exercise 4 (rated 17, recommended): what is it asking?	Does the sentinel trick work on a linked list?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise
TAOCP §6.1, exercise 5 (rated 20): what is it asking?	When can the unrolled sentinel search be slower than the simple one?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise
TAOCP §6.1, exercise 6 (rated 20, recommended): what is it asking?	Shave the inner loop further with three more MIX instructions.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise
TAOCP §6.1, exercise 22 (rated 20, recommended): what is it asking?	Find the 1000 nearest records in one scan: which data structure? A heap of the best so far.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise
TAOCP §6.1, exercise 10 (rated M20): what is it asking?	The worst ordering of a table, and how it relates to the best.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise
TAOCP §6.1, exercise 15 (rated M22, recommended): what is it asking?	Arrange a subroutine library on tape when several routines are needed at once.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise
TAOCP §6.1, exercise 11 (rated M30): what is it asking?	Limiting behavior of the move-to-front list. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise
TAOCP §6.1: how many exercises, and how are they rated?	22 exercises, rated 15 to M30.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercises
TAOCP §6.1: what should you be comfortable with first?	<ul><li>Chapter 5 basics</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::prereqs
TAOCP §6.1: how should you work through it?	Implement linear search with and without a sentinel and benchmark. Implement move-to-front on a Zipf-distributed access pattern and measure the average search length.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::approach
