Starting from:
$30

$24

Homework 3 Solution

You will need to submit a written report with part of your codes and your source code via Blackboard. You also need to bring in a hard copy of the report with part of your codes to the class on the day that this is due.

Name your header file as LastName(3 to 5 letters)_FirstNameInitial_HW5_QX.h and your implementation file as LastName(3 to 5 letters)_FirstNameInitial_HW5_QX.cpp

Note: You can only use iostream, cassert, cctype, cmath, cstdio, and cstdlib.

1. Create a template class called btNode with the following:

a. Constructors (default and copy)

b. The basic functions, i.e. set, get, isLeaf().

c. Non-member template functions for in/post/pre-order traversal

d. Non-member functions for a tree to print, copy, height, and number of nodes.

2. Create a template class for a binary tree using btNode and the given header file.

3. Create a template class for a binary tree using dynamic array and the given header file.

4. Create a template class for a Binary Search Tree using binary tree class (preferably dynamic

array).

a. Member functions to add, remove, minimum, maximum, and search.

5. Create a template class for a heap using binary tree class (preferably dynamic array).

a. Member functions to add, remove, minimum, and maximum.

b. Heapsort, return a sorted array.







Example structures of the report:

1. An overview of this homework

2. Code for question 1

3. Code for question 2

4. ... other questions

5. Any improvements, problems, etc. of the class/functions

Code should be Consolas font size 8 to 10.

More products