C S 314 Lecture Notes - Lecture 7: Parsing, Branching Factor, Binary Tree

51 views4 pages

Document Summary

Binary tree: contents and left and right links. Linked list: the first element contains the contents, the rest are a linked list of children. Implicit: a node may contain only the contents; the children can be generated from the contents or from the location of the parent. A node may not have a fixed number of children. Dedicating a large number of links would be wasteful if the average number of children is much smaller than the maximum, and it would still limit the possible number of children. Luckily, we can use the same structure as the binary tree, with just two links, and have unlimited children with no wasted space. We can think of a linked list as a tree. The first node of the list contains the contents of the node, and the rest of the list is a list of the children. The children, in turn, can be lists; a non-list is a leaf node.

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