All posts for the month February, 2014

Removing Duplicates From A List

In this assignment, you are expected to implement data structures to maintain a list of elements. In particular, implement the list as an array and as a linked list. Write a program to remove duplicates from the list. The code for remove duplicates functionality should remain the same across the two implementation of the list.

Input/ Output specifications: The input and output file names will be given as a command line argument (in that order). Input file will be a space separated sequence of integers – the content of the list in that order. Output file should have the same format (space separated sequence of integers) with the duplicates removed.

File Naming: Write the main program with remove duplicates functionality in file main.cpp. Write a header file list.h with list interfaces like insert, delete etc. Write two files array.cpp and linked list.cpp implementing the list interfaces. Your program should run successfully for the following two cases: 

  •  Compile main.cpp and list.h. Link array.cpp and generate the executable.
  •  Compile main.cpp and list.h. Link linked list.cpp and generate the executable.

Alternatively, you may use polymorphism in C++ to dynamically choose the appropriate list ADT class. Talk to your TA well in advance if you are following this or other equivalent alternative.

Expectations: Apart from the requirements mentioned above and by Prof. PanduRangan in class, the following are expected from you.

  1. Your program should execute gracefully regardless of what it is fed as input.
  2. Your code must be well-designed, modular, and easy to understand.
  3. We expect the code to be well-documented.
  4. We expect you to have learned how to use make files and some version control system. (GIT version control system was  explained in class.)
  5. All of you in the team must be familiar with all aspects of the programming assignment including make files, version control systems, etc.