I am reading algorithms by Robert Sedwick. Some definitions from the book are shown below.
A tree (also an ordered tree) is a node (called the root) connected to a sequence of disjoint trees. Such a sequence is called a forest.
A rooted tree (or unordered tree) is a node (called the root) connected to a multiset of rooted trees. (such a multiset is called an unordered forest.
My questions on the above text are
Thanks for your time and help
A tree (also an ordered tree) is a node (called the root) connected to a sequence of disjoint trees. Such a sequence is called a forest. A rooted tree (or unordered tree) is a node (called the root) connected to a multiset of rooted trees. (such a multiset is called an unordered forest.
A tree (also an ordered tree) is a node (called the root) connected to a sequence of disjoint trees. Such a sequence is called a forest. A rooted tree (or unordered tree) is a node (called the root) connected to a multiset of rooted trees. (such a multiset is called an unordered forest. I am having difficutlty in understanding above defintions.
Such a sequence is called a forest. A rooted tree (or unordered tree) is a node (called the root) connected to a multiset of rooted trees. (such a multiset is called an unordered forest. I am having difficutlty in understanding above defintions.
Note: An ordered rooted tree is rooted tree where the children of each internal vertex are ordered. Here order means child are represented in order of left to right. What is the difference between a tree and a graph?
An ordered tree (a "tree" of the first definition) has the subtrees in a particular order, and the subtree sequence cannot contain the same tree twice, because the subtrees must be disjoint. A rooted tree does not have these restrictions; by this definition a root might have a subtree twice, in a structure that resembles a cycle.
I don't have Sedwick's book to check if or why this definition makes sense; a more common definition or rooted tree would use a normal set for subtrees, rather than a multiset. Perhaps the intention is to allow multiple links between a node and its children while disallowing other kinds of cycles, such as links between siblings and cousins.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With