From 9723e0b70f267df1e27fac2af0f4229540ede3b4 Mon Sep 17 00:00:00 2001 From: Jidong Xiao Date: Thu, 26 Oct 2023 10:51:59 -0400 Subject: [PATCH] adding ds set diagram --- lectures/17_trees_I/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lectures/17_trees_I/README.md b/lectures/17_trees_I/README.md index b574384..43dee37 100644 --- a/lectures/17_trees_I/README.md +++ b/lectures/17_trees_I/README.md @@ -3,13 +3,16 @@ ## Review from Lecture 16 - STL set container class (like STL map, but without the pairs!) +- set iterators, insert, erase, find ## Today’s Lecture +- Binary trees, binary search trees - Implementation of ds_set class using binary search trees - In-order, pre-order, and post-order traversal ## 17.1 Definition: Binary Trees + - A binary tree (strictly speaking, a “rooted binary tree”) is either empty or is a node that has pointers to two binary trees. @@ -100,8 +103,7 @@ integer. Hint: think recursively! ## 17.7 ds_set and Binary Search Tree Implementation -- A partial implementation of a set using a binary search tree is in the code attached. We will continue to study -this implementation in Lab 10 & the next lecture. +- A partial implementation of a set using a binary search tree is [here](ds_set_starter.h). We will continue to study this implementation in Lab 10 & the next lecture. - The increment and decrement operations for iterators have been omitted from this implementation. Next week in lecture we will discuss a couple strategies for adding these operations. - We will use this as the basis both for understanding an initial selection of tree algorithms and for thinking @@ -121,6 +123,8 @@ node) that does all of the work. - Because the class stores and manages dynamically allocated memory, a copy constructor, operator=, and destructor must be provided. +![alt text](ds_set_diagram.png "ds set diagram") + ## 17.9 Exercises 1. Provide the implementation of the member function ds_set::begin. This is essentially the problem of