flâneur — a map of the web's best reading

Lab 10: Trees and Traversals | CS 61BL Summer 2024

cs61bl.org · saved by 1 readers

In this lab, we will introduce another data structure called a tree (you might have already seen this in CS 61A or another equivalent course). The meaning of the tree data structure originates from the notion of a tree in real life. Below is a conceptual visualization of a tree. It’s not really a box and pointer diagram and should not be interpreted as a literal implementation in Java. Note that while a tree in real life is rooted at the bottom and branches out and upwards, trees in computer science are typically drawn such that they are rooted at the top and branch out and downwards. For this lab, we have not provided you with any local tests. Instead, we expect you to create your own test file and write your own tests! You can also use ad-hoc testing in the main methods to test quickly. In order to be able to talk about trees, we first need to define some terminology. These following terms are defined with respect to a particular node. Sometimes we’ll refer to the height and depth of

In this lab, we will introduce another data structure called a tree (you might have already seen this in CS 61A or another equivalent course). The meaning of the tree data structure originates from the notion of a tree in real life. Below is a conceptual visualization of a tree. It’s not really a box and pointer diagram and should not be interpreted as a literal implementation in Java. Note that while a tree in real life is rooted at the bottom and branches out and upwards, trees in computer science are typically drawn such that they are rooted at the top and branch out and downwards. For this

Explore this link on the map →

saved by