A **free tree** is a connected, acyclic, undirected [[graphs|graph]]. If an undirected graph is acyclic but possibly disconnected, it is a **forest**.
%%ANKI
Basic
What is a free tree?
Back: A connected, acyclic, undirected graph.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844897-->
END%%
%%ANKI
Basic
What is a forest?
Back: An acyclic undirected graph.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844903-->
END%%
%%ANKI
Basic
What additional property must an undirected graph exhibit to be a forest?
Back: It must be acyclic.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844906-->
END%%
%%ANKI
Basic
What additional properties must an undirected graph exhibit to be a free tree?
Back: It must be acyclic and connected.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844909-->
END%%
%%ANKI
Basic
What additional properties must a forest exhibit to be a free tree?
Back: It must be connected.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844912-->
END%%
%%ANKI
Basic
What additional properties must a free tree exhibit to be a forest?
Back: N/A
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844915-->
END%%
%%ANKI
Basic
If the following isn't a free tree, why not?
![[free-tree.png]]
Back: N/A
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844918-->
END%%
%%ANKI
Basic
If the following isn't a free tree, why not?
![[forest.png]]
Back: Because it is disconnected.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844922-->
END%%
%%ANKI
Basic
If the following isn't a free tree, why not?
![[cyclic-undirected.png]]
Back: Because it contains a cycle.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844926-->
END%%
%%ANKI
Basic
If the following isn't a forest, why not?
![[free-tree.png]]
Back: N/A
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844930-->
END%%
%%ANKI
Basic
If the following isn't a forest, why not?
![[forest.png]]
Back: N/A
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844934-->
END%%
%%ANKI
Basic
If the following isn't a forest, why not?
![[cyclic-undirected.png]]
Back: Because it contains a cycle.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844939-->
END%%
%%ANKI
Basic
How do free trees pictorially relate to forests?
Back: A forest is drawn as one or more free trees.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844943-->
END%%
A **rooted tree** is a free tree in which one vertex is distinguished/blessed as the **root**. We call vertices of rooted trees **nodes**.
Let $T$ be a rooted tree with root $r$. Any node $y$ on the simple path from $r$ to node $x$ is an **ancestor** of $x$. Likewise, $x$ is a **descendant** of $y$. If the last edge on the path from $r$ to $x$ is $\{y, x\}$, $y$ is the **parent** of $x$ and $x$ is a **child** of $y$. Nodes with the same parent are called **siblings**.
A node with no children is an **external node** or **leaf**. A node with at least one child is an **internal node** or **nonleaf**. The number of children of a node is the **degree** of said node. The length of the simple path from the root to a node $x$ is the **depth** of $x$ in $T$. A **level** of a tree consists of all nodes at the same depth. The **height** of a node in a tree is the length of the longest simple path from the node to a leaf.
%%ANKI
Basic
What is a rooted tree?
Back: A free tree in which one of the vertices is distinguished from the others.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844947-->
END%%
%%ANKI
Basic
Is every rooted tree a free tree?
Back: Yes.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844951-->
END%%
%%ANKI
Basic
Is every free tree a rooted tree?
Back: No.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844955-->
END%%
%%ANKI
Basic
Which free trees are not considered rooted trees?
Back: Those without some vertex identified as the root.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844958-->
END%%
%%ANKI
Basic
What distinguishes a node from a vertex?
Back: A node is a vertex of a rooted tree.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844962-->
END%%
%%ANKI
Basic
Is every vertex a node?
Back: No.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844966-->
END%%
%%ANKI
Basic
Is every node a vertex?
Back: Yes.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844969-->
END%%
%%ANKI
Cloze
{Nodes} are to rooted trees whereas {vertices} are to free trees.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844973-->
END%%
%%ANKI
Basic
Which of free trees or rooted trees is a more general concept?
Back: Free trees.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1711136844976-->
END%%
%%ANKI
Basic
What does it mean for node $y$ to be an ancestor of node $x$ in a rooted tree?