CS590 homework 2 – Lists, Stacks, and Queues Solved

35.00 $

Category:

Description

5/5 - (1 vote)

1. Design, and implement two algorithms to remove duplicates from an unsorted single Linked-List. You
are given the implementation of the single Linked-List in the files LinkedList.h, and LinkedList.cpp. You are
also given the skeleton code in problem1.cpp where you will implement the requested solution. A test
case has been provided in the main() function, but feel free to write additional test cases to make sure
your code works. (Additional test cases are not requested, and will not be graded).
a) for the first algorithm, you can use an additional data structure (one of the STL containers –
you can add one include to the header file for that container of the STL you decide to use)
b) for the second algorithm, no additional data structure can be used
2. Design, and implement a C++ class that implements the queue data structure, using two stacks. For the
stacks, you are allowed to use the stacks implementation of C++ STL, already included in the source code
shared with you. In the problem2.cpp file you will find a skeleton of the code where you have to implement
the requested solution. A test case has been provided in the main() function, but feel free to write
additional test cases to make sure your code works. (Additional test cases are not requested, and will not
be graded).

  • Assignment2-6qwdhl.zip