Lab 7

Binary Search Trees

Goals

  • Implement a binary search tree (BST) node class to reinforce our understanding how BSTs work
  • Gain more practice using recursion to work with data and solve problems
  • Continue practicing using unit tests to help us debug our code
  • Explore the application of BSTs for a real-world problem

Welcome to our seventh CSCI 151 lab! The lab can be started by following this link to create a copy of the assignment for you on GitHub: https://classroom.github.com/a/R342qzue

In this week’s lab, we will be exploring the binary search tree data structure by (1) creating our own implementation of a binary search tree node class to better understand how BSTs sort data, and (2) applying BSTs in a real-world application developing a search engine for books that have been popular on GoodReads. We will also continue practicing using unit tests for testing our code piecewise as we develop it (rather than waiting until we’ve written a lot of intertwined code that is difficult to debug).

We will once again begin with a Warmup designed to help reinforce some of the key concepts needed to complete the lab assignment. You are strongly encouraged to work with a partner on the Warmup during the lab period.

As a friendly reminder, there is also lab helping available outside of your regularly scheduled lab time. A calendar and description can be found here. Please make use of the lab helping available as much or as little as you need; it is there to assist you as we learn together this semester. Please also feel free to reach out to your professor by email or stop by office hours with any questions.