#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
#columns:Front	Back	Tags
TAOCP §2.2.4 Circular Lists: what does it cover?	Lists whose last node points back to the first, which makes some operations simpler. The main example is adding and multiplying polynomials stored as circular lists of terms.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::about
TAOCP §2.2.4: why does it matter?	Circular lists are used in schedulers, LRU caches and buffer rings. The polynomial example is a great exercise in pointer surgery.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::why
TAOCP §2.2.4: what traps should you watch for?	<ul><li>Infinite loops when traversing a circular list without a sentinel or stop condition.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::traps
TAOCP §2.2.4, exercise 3 (rated 20, recommended): what is it asking?	Work out what concatenation does when both pointers are in the same circular list.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise
TAOCP §2.2.4, exercise 5 (rated 21, recommended): what is it asking?	Reverse the links of a circular list.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise
TAOCP §2.2.4, exercise 8 (rated 10, recommended): what is it asking?	Why the polynomial addition loop keeps a trailing pointer.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise
TAOCP §2.2.4, exercise 9 (rated 23, recommended): what is it asking?	Check whether polynomial add and multiply survive aliased arguments. Aliasing bugs, early.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise
TAOCP §2.2.4, exercise 13 (rated 20): what is it asking?	Write a MIX subroutine that returns a whole polynomial to the free list.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise
TAOCP §2.2.4, exercise 17 (rated 22, recommended): what is it asking?	Argue why circular lists beat null-terminated ones for polynomials.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise
TAOCP §2.2.4, exercise 15 (rated 24): what is it asking?	Write polynomial multiplication as a MIX subroutine.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise
TAOCP §2.2.4, exercise 18 (rated 25, recommended): what is it asking?	Traverse a list in both directions with only one link field per node. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise
TAOCP §2.2.4: how many exercises, and how are they rated?	18 exercises, rated 10 to M28.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercises
TAOCP §2.2.4: what should you be comfortable with first?	<ul><li>2.2.3 Linked Allocation</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::prereqs
TAOCP §2.2.4: how should you work through it?	Implement polynomial addition with circular linked lists in C, following the algorithm in the text. Test with polynomials that cancel terms.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::approach
