{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

10b - TreesSlides

# The height of a tree is one more than the height

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: e height of a tree is one more than the height greatest number of ancestors of any node. An element ( call it a node) immediately above node another node is called the parent of those nodes parent immediately immediately below, which are called the children children of the node above. Also called the depth (although that term is often depth (although used just for nodes) used just for nodes). The terms ancestor and descendant are also ancestor descendant used to indicate relative position in the tree. Now that we've got some terms, let's see if we can define what a tree is. It turns out to be a recursive definition. 1 Here is an example of a tree: A tree is defined as follows R • an empty tree, one with no nodes, is a tree L L L subtree • a single node is a tree • the structure formed by taking one or more trees and a single node not in any other tree and making that node the parent of all the roots of the other trees is a tree LL L L L L LL L L One special form of tree is called a binary tree It is a tree with the extra property that a node may not have more than 2 children. These (possible...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern