Implement a binary search tree

Assignment Help C/C++ Programming
Reference no: EM132222464

Assignment 1

Implement the following specification of UnsortedType using a circular linked list as the implementation structure.

template class <ItemType>
struct NodeType;

/* Assumption: ItemType is a type for which the operators
"<" and "==" are defined-either an appropriate built-in type or a class that overloads these operators. */

template <class ItemType>
class UnsortedType
{
public:
// Class constructor, destructor, and copy constructor
UnsortedType();
~UnsortedType();
UnsortedType(const UnsortedType<ItemType>&);

void operator=(UnsortedType<ItemType>);

bool IsFull() const;
// Determines whether list is full.
// Post: Function value = (list is full)

int GetLength() const;
// Determines the number of elements in list.
// Post: Function value = number of elements in list.

void RetrieveItem(ItemType& item, bool& found);
// Retrieves list element whose key matches item's key
// (if present).
// Pre: Key member of item is initialized.
// Post: If there is an element someItem whose key matches
// item's key, then found = true and item is a copy of
// someItem; otherwise found = false and item is
// unchanged.
// List is unchanged.

void InsertItem(ItemType item);
// Adds item to list.
// Pre: List is not full.
// item is not in list.
// Post: item is in list.

void DeleteItem(ItemType item);
// Deletes the element whose key matches item's key.
// Pre: Key member of item is initialized.
// One and only one element in list has a key matching
// item's key.
// Post: No element in list has a key matching item's key.

void ResetList();
// Initializes current position for an iteration through the
// list.
// Post: Current position is prior to list.

void GetNextItem(ItemType&);
// Gets the next element in list.
// Pre: Current position is defined.
// Element at current position is not last in list.
// Post: Current position is updated to next position.
// item is a copy of element at current position.

private:
NodeType<ItemType>* listData;
int length;
NodeType<ItemType>* currentPos;
};

Deliverables
- A listing of the specification and implementation files for UnsortedType
- A listing of the driver program for your test plan
- A listing of the test plan as input to the driver
- A listing of the output from the driver

Programming Assignment 2

A toy that many children play with is a base with three pegs and five disks of different diameters. The disks begin on one peg, with the largest disk on the bottom and the other four disks added on in order of size. The idea is to move the disks from the peg they are on, to another peg by moving only one disk at a time and without ever putting a larger disk on top of a smaller one. This child's toy is actually an example of a classic mathematical puzzle called the Towers of Hanoi problem.

Write a recursive solution to this problem. It may take you a while to see the solution, but the program itself is quite short.

Input
The program should prompt for and input the number of Rings.For this program please use 3 pegs and 5 rings.

Output
The series of moves should be written to the screen, properly labeled.

Deliverables
• A listing your program
• A copy of your screen output

Programming Assignment 3
Your assignment is to implement a Binary Search Tree using the employee class you developed in Week 2. The employee class should contain the employee information listed in the "input" section below. The program should contain all functions listed in the functionality section below.

Input
Data about current employees should be on the file "Employee.txt". You will need to create your own employee file and submit it with the final project.

Each employee should have the following attributes:
• Employee_Number Integer
• Employee_Last_Name String
• Employee_First_Name String
• Employee_Years_of_Service Integer

3 employees must be loaded from the Employee.txt file on program start up.

Functionality

Command

Processing

ADD

Allows the user to "Add" an employee to the tree

REMOVE

Allows the user to "Remove" an employee from the tree

COUNT

Returns the number of Employees in the tree

PRINT

Prints the employee information in the list to the console

QUIT

Stops processing

Output
All output should be on the console.

Data Structures
This program should utilize a binary search tree.

Deliverables
• Neat and well commented program
• Complete zipped Visual Studio Project

Verified Expert

This assignment is implemented in c++ programming language. Binary search tree, ciregular linked list and tower of Hanoi are implemented using oops concepts. Binary search tree is implemented on employee records. Circular linked list is implemented to support different types of values.

Reference no: EM132222464

Questions Cloud

Identify key hurricane mitigation steps : Identify key earthquake mitigation steps. Identify key hurricane mitigation steps. What types of crisis events provide a warning period?
What are these other agency relationships : What are these other agency relationships? How would you respond to this person? Do you accept or reject this view?
Why is fight against corruption long-term battle : How would you describe a resource-based view of global? Why is a fight against corruption a long-term battle?
Typically the starting point for supply chain network models : The parameters in the supply chain network model should be accepted if. Historical demand is typically the starting point for supply chain network models.
Implement a binary search tree : Implement the specification of UnsortedType using a circular linked list as the implementation structure - listing of the specification and implementation files
Many reasons to implement supply chain network planning : Some of the many reasons to implement a supply chain network planning exercise include:
Negative impacts on society due to technological innovation : What are some of the negative impacts on society due to technological innovation?
Supply chain network models recommend : Optimized supply chain network models suggest solutions that have. Supply Chain Network models recommend.
Zappos method of testing loyalty of its employees : Zappos’ method of testing loyalty of its employees by paying them to leave also shows employees’ degree of. Which of following are flows in network operations.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd