Lecture08 - Basics of Trees EECS 233-2 Hierarchies...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Basics of Trees EECS 233-2- Hierarchies Everywhere Your local directory structure Governmental and organizational structures General approach of dealing with large-scale computer systems Kazaa P2P network (peers and superpeers) Gnutella 2 Hostnames IP addresses Internet Autonomous systems OSPF areas Trees are natural representation of hierarchies-3- Mundane Example: Maintaining a Sorted Collection of Data A data dictionary is a sorted collection of data with the following key operations: search for an item (and possibly delete it) insert a new item If we use a list (in previous lectures) to implement a data dictionary, efFciency = O (n). Various tree structures allow for a more efFcient data dictionary. O (n), (O(1) to do the actual insertion, but O (n) to Fnd the right spot) O (n) using linear search a list implemented using a linked list O (n) because we need to shift items over O (log n) using binary search a list implemented using an array (sorted) inserting an item searching for an item data structure-4- What Is A Tree? A tree consists of: a set of nodes, with one of them distinguished as a root a set of edges , each of which connects a pair of nodes no cycles Each node may have an associated data item (“payload”). consists of one or more Felds key feld = the Feld used when searching for a data item The node at the “top” of the tree is called the root of the tree.-5- Relationships Between Nodes If a node N is connected to other nodes that are directly below it in the tree, N is referred to as their...
View Full Document

This note was uploaded on 04/07/2008 for the course EECS 233 taught by Professor Rabinovich during the Spring '08 term at Case Western.

Page1 / 19

Lecture08 - Basics of Trees EECS 233-2 Hierarchies...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online