lec18 - Click to edit Master subtitle style 2/7/11 CS/IS...

Info iconThis preview shows pages 1–7. 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: Click to edit Master subtitle style 2/7/11 CS/IS C363 DS&A Binary Trees- Traversal(s) and Applications 2/7/11 11 CS/IS C363 DS&A 2/7/11 CS/IS C363 DS&A Binary Tree Review Definition: A Binary Tree is either an empty Binary Tree OR has a root value and two (sub) Binary Trees. Type Definition BinaryTree = EmptyBinaryTree U (Element * BinaryTree * BinaryTree) Representation (in C) typedef struct _binTree *BinTree; 2/7/11 CS/IS C363 DS&A 22 2/7/11 CS/IS C363 DS&A Binary Tree Review [2] BinaryTree - Operations BinTree createBinTree() boolean isEmptyBinTree(BinTree) Properties: 2/7/11 CS/IS C363 DS&A 33 2/7/11 CS/IS C363 DS&A Binary Tree Review [2] BinaryTree - Operations BinTree left(BinTree) BinTree right(BinTree) Element rootVal(BinTree) BinTree makeBinTree(Element, BinTree, BinaryTree) 2/7/11 CS/IS C363 DS&A 44 2/7/11 CS/IS C363 DS&A Binary Tree - Traversals Typical Requirements for a traversal: Enumerating the elements in a collection (represented as a binary tree) Applying some function / procedure on each element in a collection (represented as a binary tree) Order of traversal In-Order Traversal: 2/7/11 CS/IS C363 DS&A 55 2/7/11 CS/IS C363 DS&A Binary Tree - Traversals Consider an expression of the form: (* (* 3 4) (+5 7)) Referred to as a prefix expression.Referred to as a prefix expression....
View Full Document

Page1 / 17

lec18 - Click to edit Master subtitle style 2/7/11 CS/IS...

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

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