I am facing a problem with my semester-end project for Data Structures and Algorithms. After discussions with my teacher and classmates, we made some changes to our proposal. We now need to add a “search book by campus” functionality. The requirements are:
-
First, search for the book in the main campus library.
-
If not found, then search in the other two campuses one by one.
-
Display a message indicating whether the book is present in the main campus, all campuses, or only in one or two campuses.
I have been asked to implement this functionality using a binary search tree (BST). I am confused about how to approach this problem with a BST. Initially, I tried using a stack, but my instructor specified that it should be done using trees.
Could someone guide me on how to implement this search functionality using a BST? Any help or code examples would be greatly appreciated.
Code Chase1280 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.