Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C++ create a template class Tree that will create a binary search tree with nodes of type . Include the following three constructors: 1.

Using C++ create a template class Tree that will create a binary search tree with nodes of type.

Include the following three constructors:

1. a default constructor that returns a pointer to an empty tree

2. a constructor that accepts a constant parameter of type and returns a new tree with one node

3. and a constructor that accepts a parameter of Tree that returns a copy of the binary search tree passed to the constructor (this will be the copy constructor for the class).

The Tree class needs to include the following:

type find(type key) : find key in the tree.

void insert(ype key) : insert a new node into the tree, preserving the sorted property of the tree

void delete(type key) : delete an existing node from the tree, preserving the sorted property of the tree

void inorder() : print the tree with an inorder traversal

void postorder() : print with a postorder traversal

void preorder() : print with a preorder traversal

Along with Unit test scripts for the code and a UML diagram.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions

Question

Explain the purpose of a business plan.

Answered: 1 week ago