## Notes Information

Login / Sign Up to View Document

## 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

© Copyright 2021 , Koofers, Inc. All rights reserved.

The information provided on this site is protected by U.S. and International copyright law, and other applicable intellectual property laws, including laws covering data access and data compilations. This information is provided exclusively for the personal and academic use of students, instructors and other university personnel. Use of this information for any commercial purpose, or by any commercial entity, is expressly prohibited. This information may not, under any circumstances, be copied, modified, reused, or incorporated into any derivative works or compilations, without the prior written approval of Koofers, Inc.