Starting from:

$25

CS1575 - HOMEWORK 3 -Solved

Problem:

You were so successful with the arraylist software module, that you have now been licensing it to planets all around the galaxy. However, The Nibblonian Council from planet Eternium finds your array implementation an example of the wastefulness of the human species. You really want to sell something to the Nibblonian Council, as they will license many copies of a “List Abstract Data Type” for the software in their new cute ship armada.

Implement a Linked-List version of the List ADT, and show the Nibblonians that you can both save memory and wrangle a whole herd of wild pointers. A 'linkedlist.h' file has been provided for you to the wishes and whims of the great Nibblonian Council.

 

Kitten[1] class attack ships.

Testing:

Use the provided tester files to check if your implementation is working correctly.

●    The program ‘tester.cpp’ uses the LinkedList class and the intended output is ‘testeroutput.txt’.

In this assignment, you will be penalized for memory leaks. To test for leaks, you can use the "Valgrind" tool available in the UNIX systems: After compiling with:

fg++ tester.cpp -o tester.ex

run your program with the command

valgrind --leak-check=full ./tester.ex

IMPORTANT: Your  'linkedlist.hpp'  should NOT '#include <linkedlist.h>'



Useful Hints:

1.    Carefully read the comments of each member function.

2.    Write down an algorithm for a function before you start coding it.

3.    Develop your member functions one at a time, starting from the simplest ones.

Move to the next function only after the previous one has been tested. Trying to code the whole class and then remove the bugs may prove to be too big a task.

4.    Suggestion: Implement  ‘operator<<' and  ‘insert_front()’ first.

5.    When a function that needs to return something encounters an error, return as specified in the documentation ( most of the times just NULL ).

6.    There is an auxiliary constructor already written in the header file, which is handy for the implementation of the insertion functions.


 
[1] Actual designation, check https://en.wikipedia.org/wiki/Futurama

More products