Koofers

Lecture Notes for CS 112 - Intro to Computer Science II at University of San Francisco (USF)

Notes Information

Material Type:Class Note
Professor:Staff
Class:CS 112 - Intro to Computer Science II
Subject:Computer Science
University:University of San Francisco (CA)
Term:Spring 2008
Keywords:
  • On the Right
  • On the Left
  • Binary Search
  • Immediately
  • Special Case
  • Manipulation
  • Implementation
  • Implementing
  • Original Problem
  • Ordered List
Login / Sign Up to View Document
Preview Page 1Preview Page 2Preview Page 3Preview Page 4Preview Page 5Preview Page 6

Sample Document Text

CS112-2008S-34 More Binary Search Trees 1 34-0: Binary Trees Binary Trees are Recursive Data Structures . Base Case: Empty Tree . Recursive Case: Node, consiting of: . Left Child (Tree) . Right Child (Tree) . Data 34-1: Binary Search Trees . Binary Trees . For each node n, (value stored at node n) ? (value stored in left subtree) . For each node n, (value stored at node n) < (value stored in right subtree) 34-2: Example Binary Search Trees 4 3 2 1 4 2 6 5 71 3 1 2 3 4 34-3: Binary Search Trees class BSTNode { private int data; private BSTNode left; private BSTNode right; public BSTNode(int data, BSTNode left, BSTNode right) { this.left = left; this.right = right; this.data = data; } public BSTNode left() { return left; } public BSTNode right() public int data() { { return right; return data; } } } 34-4: Binary Search Trees CS112-2008S-34 More Binary Search Trees 2 class BSTNode { ... public BSTNode left() public void setLeft(BSTNode newLeft) { { return left;...

Related Documents

On the Left Notes
On the Right Notes
On the Left Notes
On the Left Notes
On the Left Notes
On the Left Notes
On the Left Exam
On the Left Notes
On the Right Exam
On the Left Quiz
On the Left Notes
On the Right Notes
On the Right Notes
On the Right Exam
On the Right Notes
On the Right Exam
155, "/var/app/current/tmp/"