Exercises from chapter 6 of Data Structures and Algorithms with Javascript by Michael McMillan