Chapter 6 of EJS and ch1 of Data Structures