CSE 2221 Study Guide - Midterm Guide: Xml, Binary Tree, New Math

152 views2 pages

Document Summary

Recursive structure: a tree is made up of, a root node, a string of zero or more child nodes of the root, each of which is the root of its own tree. Since a tree may contain other trees, its structure is recursive: note: the following explanation of trees is adequate for present purposes but is not technically complete. Children of root node (k, r, and s) Path or length is the amount of nodes: root node (b, height of a tree is the length of the longest path from its root; here, it is 4. ), as this is done for you by xmltree. Every node in the tree has two key properties, or invariants: It has a label tri(cid:374)g that is either a tag (cid:894)e. g. , (cid:862)author(cid:863)(cid:895) or so(cid:373)e ordi(cid:374)ar(cid:455) te(cid:454)t (cid:894)e. g. , (cid:862)ca(cid:455) If and only if its label is a tag, then it has zero or more attribute name-value pairs, each of which is a string.