Intermediate Programming Assignment 6: Binary Search Trees and Recursion, Assignments of Electrical and Electronics Engineering

Information about programming assignment 6 for ece 231 intermediate programming course, which focuses on binary search trees, template, and recursion. Students are required to understand the codes in figure 12.7 and 12.8, add additional operations to the bst class template, and modify the test driver function to test each new function. The required files bst.h and treetester.cpp, and students need to provide the implementation of the additional functions and modify the test file accordingly.

Typology: Assignments

Pre 2010

Uploaded on 07/23/2009

koofers-user-1qr
koofers-user-1qr 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECE 231 Intermediate Programming
Fall 2008
Programming Assignment 6
Binary Search Trees, Template and Recursion
Due 12/04/2008, Thursday
Purpose
This assignment will give you practice with binary search trees, template and recursion.
Reading
The material on binary search trees is covered in Chapter 12. Templates are covered in
Chapter 9. Before you start working on this assignment, you are required to understand
the codes in Figure 12.7, which shows the contents of the BST class template. Figure 12.8
shows a driver program to test BST.
Programming Assignment
This assignment requires you to add some additional operations in the BST class template
and modify the test driver function to test each additional function you added. You are
required to add these in BST class template:
1. destructor
2. copy constructor
3. assignment operator
4. A recursive function member nodeCount() to count the nodes in a BST.
5. A recursive function member level()that determines the level in the BST at
which a specified item is located. (The root of the BST is at level 0, its children
are at level 1, and so on)
6. A recursive function member height()to determine the height of the BST.
Height is the number of the levels in the tree.
To help you to start working on this assignment, I will upload two files, which are in
Figure 12.7 and 12.8. They are BST.h and treetester.cpp. I also provide the
declarations of all the additional functions in BST.h file. You are required to provide
implementation of them. And you also need to modify treetester.cpp file to test
each additional function you added in BST class template.

Partial preview of the text

Download Intermediate Programming Assignment 6: Binary Search Trees and Recursion and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

ECE 231 Intermediate Programming

Fall 2008

Programming Assignment 6

Binary Search Trees, Template and Recursion

Due 12/04/2008, Thursday

Purpose

This assignment will give you practice with binary search trees, template and recursion.

Reading

The material on binary search trees is covered in Chapter 12. Templates are covered in Chapter 9. Before you start working on this assignment, you are required to understand the codes in Figure 12.7, which shows the contents of the BST class template. Figure 12. shows a driver program to test BST.

Programming Assignment

This assignment requires you to add some additional operations in the BST class template and modify the test driver function to test each additional function you added. You are required to add these in BST class template:

  1. destructor
  2. copy constructor
  3. assignment operator
  4. A recursive function member nodeCount() to count the nodes in a BST.
  5. A recursive function member level()that determines the level in the BST at which a specified item is located. (The root of the BST is at level 0, its children are at level 1, and so on)
  6. A recursive function member height()to determine the height of the BST. Height is the number of the levels in the tree.

To help you to start working on this assignment, I will upload two files, which are in Figure 12.7 and 12.8. They are BST.h and treetester.cpp. I also provide the declarations of all the additional functions in BST.h file. You are required to provide implementation of them. And you also need to modify treetester.cpp file to test each additional function you added in BST class template.