Page 2 of 25CSE 100, UCSD: LEC 1CSE 100 web pages✔All information related to the course is available in the textbook or online, following links from the class home page:http://ieng6.ucsd.edu/~cs100f✔You’re responsible for knowing that information, so make a note of that URL and read what’s there

Page 4 of 25CSE 100, UCSD: LEC 1Data structures, in general✔A data structure is... a structure that holds data✔A data structure is an object that offers certain useful operations (its “Application Programmer Interface”, or API), for example storing, retrieving, and deletingdata of a certain type✔A data structure may offer certain performance guarantees on its operations, for example certain best-, worst-, or average-case time or space costs✔To meet performance guarantees, a data structure may need to be implemented in a particular way✔In CSE 100 we will study the performance guarantees that are permitted by various data structure implementations✔We will begin by reviewing trees...

Page 5 of 25CSE 100, UCSD: LEC 1A review of trees✔A tree is a hierarchical (not just linear, and not unstructured!) data structure✔A tree is a set of elements called nodes, structured by a "parent" relation:✗If the tree is nonempty, exactly one node in the set is the rootof the tree✗The root of a tree is the unique node that has no parent✗Every node in the set except the root has exactly one other nodethat is its parent

This preview
has intentionally blurred sections.
Sign up to view the full version.

Page 6 of 25CSE 100, UCSD: LEC 1Drawing trees✔The root goes at the top: here node A is the root of the tree (in Computerscienceland, trees grow upside down)✔The parent of a node is drawn above that node, with a "link" or "edge" from the node to its parent: here node A is the parent of nodes B,C ; and B,C are called the childrenof A✔Some nodes have no children, and are called leavesof the tree: here nodes D, G, I, J, L are leavesABCDEFGHIJKL

Page 7 of 25CSE 100, UCSD: LEC 1

This preview
has intentionally blurred sections.
Sign up to view the full version.