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

  Write specifications for a method

Write specifications for a method that advances any given date by one day. Include a statement of purpose, pre- and post-conditions, and a description of the parameters.

  Write a recursive function that takes a string as parameter

Write a recursive function that takes a string as a parameter and prints its reversal in the same function in c++

  Identify one practice mentioned in the text and research

Good Programming practices are necessary but different in every environment. Identify one practice mentioned in the text and research some others. What makes these good? Can you think of a reason why one would not use the good practice?

  Problem on enhance the hash set class

Suppose you were asked to enhance the Hash Set class. Suggest one new method for that class that could be used to manipulate the data in a variety of ways.

  To use a sentinel loop so once the value of -99 i

modify this program to use a sentinal loop so once the value of -99 is entered after getting the pay and hours the program should end.

  Design a new class c non-routable network

Design a new Class C non-routable network

  Write a function that takes three arguments

Write a function that takes three arguments: the name of an int array, array size, and an int value. Have function set each element of the array to int value.

  Displays the information about the movie

researching constructors and dimensions. Can someone assist with explaining how to code such an example

  Program that can serve as a simple calculator

Write a program that can serve as a simple calculator. This calculator keeps track of a single number (of type double) that is called result and that starts out as 0.0. Each cycle allows the user to repeatedly add, subtract, multiply, or divide by..

  Write a function to compute the average amount of food eaten

Write a function to compute the average amount of food eaten per day by the whole family of monkeys; write a function to compute the least amount of food eaten by any monkey.

  Design a program read the following information from the

design a program read the following information from the keyboard in which base class consist of employee name code and

  Write the decimal equivalents for these ieee floating point

Write the result of the following addition as both 8-bit binary and decimal numbers. For each part, use standard binary

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