Exercises from chapters 4 and 5 of Data Structures and Algorithms with Javascript by Michael McMillan