Lab 9

Purpose

This lab assignment focuses on recursion. You will also be introduced to a BST data structure; however, the main focus of this lab is recursion. BST stands for Binary Search Tree.

Key Reading

  • 11.1-11.3
  • 12.4

Requirements

Part 1 - Tree of Numbers (10 points)

  • Write a java application that:
    • randomly generates 50 integers in the range -50 to 50
    • recursively inserts the 50 integers into a BST
    • Duplicate values should be accepted in your BST. When adding duplicate values, you as the programmer may decide which side they are added to.

Part 2 - Number Show (10 points)

  • Recursively display the integers by traversing the BST from Part 1 so that they appear in sorted order (lowest to highest).
Designed by Andy Griffin