CSC148H1 Lecture Notes - Lecture 8: Longest Path Problem, The Item, The Leaves

21 views9 pages
13 Nov 2017
School
Course
Professor
katrinasavvy and 38715 others unlocked
CSC148H1 Full Course Notes
1
CSC148H1 Full Course Notes
Verified Note
1 document

Document Summary

While lists are a really useful data structure, not all data has a natural linear order. In computer science, we have use a tree data structure to represent this type of data. Trees are a recursive data structure, with the following definition: A tree can have a root value connected to any number of other trees, called the subtrees of the tree. Intuitively, the root of the tree is the item which is located at the top of the tree; the rest of the tree consists of subtrees which are attached to the root. Note that a tree can contain a root value but not have any subtrees: this would represent a tree that contains just a single item. Every non-empty tree has a root node (which is generally drawn at the top of the tree), connected to zero or more subtrees. The root node of the above tree is labelled a.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents