Lecture13

Lecture13 - CS2134 Lecture 13 Binary Trees CS2134 Trees –...

Info iconThis preview shows pages 1–5. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS2134 Lecture 13 Binary Trees CS2134 Trees – Up to now, the data structures we’ve studied (vectors, stacks queues, lists) have stored sequences of data • each item has a single successor – Often, data is organized hierarchically, not sequentially • organization chart for a company • classification of the animal kingdom • file system – Trees can be used to characterize such relationships: • items may have several successors, called children – We’ll focus on binary trees , in which each node has at most two children • in addition to applications to hierarchical data, these have applications to searching and sorting. CS2134 Binary trees • Def 1: – empty, or – unique root node, and – each node has at most two children, the left child and the right child , and – for each node there a unique path from the root “down” to the node. • Def 2: – empty, or – a node, or – a node along with two trees, the right subtree and the left subtree CS2134 Terminology...
View Full Document

This note was uploaded on 12/09/2009 for the course CS 2134 taught by Professor Hellerstein during the Spring '07 term at NYU Poly.

Page1 / 9

Lecture13 - CS2134 Lecture 13 Binary Trees CS2134 Trees –...

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

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