From abb1bad0e018a14909faa2f5b0da5334aa00972f Mon Sep 17 00:00:00 2001 From: NehaKeshan <39170739+NehaKeshan@users.noreply.github.com> Date: Fri, 27 Oct 2023 09:03:42 -0400 Subject: [PATCH] Update README.md added overview of lists vs trees vs graphs --- lectures/17_trees_I/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lectures/17_trees_I/README.md b/lectures/17_trees_I/README.md index 26f3788..8c7e1f7 100644 --- a/lectures/17_trees_I/README.md +++ b/lectures/17_trees_I/README.md @@ -11,6 +11,11 @@ - Implementation of ds_set class using binary search trees - In-order, pre-order, and post-order traversal +## Overview: Lists vs Trees vs Graphs +- Trees create a hierarchical organization of data, rather than the linear organization in linked lists (and arrays and vectors). +- Binary search trees are the mechanism underlying maps & sets (and multimaps & multisets). +- Mathematically speaking: A _graph_ is a set of vertices connected by edges. And a tree is a special graph that has no _cycles_. The edges that connect nodes in trees and graphs may be _directed_ or _undirected_. + ## 17.1 Definition: Binary Trees - A binary tree (strictly speaking, a “rooted binary