7.4-bst_implementation

7.4-bst_implementati - CMPT 225 Binary Search Tree Implementation CMPT 225 Review BST CMPT 225 BST Operations • Create BST(empty or with root •

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: CMPT 225 Binary Search Tree Implementation CMPT 225 Review: BST CMPT 225 BST Operations • Create BST (empty or with root) • Insert this element • Remove this element • Retrieve this element • Traverse (3 flavours) • Successor of this element • Predecessor of this element • Minimum of tree • Maximum of tree • Size of tree CMPT 225 Implementing BST as an ADT • Part 1 • Public interface (or specification) • insert • remove • retrieve • preOrder • inOrder • postOrder • successor • predecessor • minimum • maximum • size CMPT 225 Implementing BST as an ADT • Part 2 • Implementation #1 • Index-based – version 1 BinaryTreeNode CMPT 225 class BinaryTreeNode In pseudocode class BinaryTreeNode { private ElementType element; // element stored in tree node private int leftChild; // index to left child/subtree private int rightChild; // index to right child/subtree … }...
View Full Document

This note was uploaded on 01/29/2012 for the course CMPT 225 taught by Professor Annelavergne during the Summer '07 term at Simon Fraser.

Page1 / 16

7.4-bst_implementati - CMPT 225 Binary Search Tree Implementation CMPT 225 Review BST CMPT 225 BST Operations • Create BST(empty or with root •

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