CS
2500 Spring 2011
Lab 6
Using the List ADT
We want to
better understand the list ADT and how to use it.
- Write a program to merge two lists of integers that are
sorted in ascending order. The result should be a third list
that is the sorted combination of the origninal lists.
- Your program should take user input from
the keyboard to insert up to
10 elements into each list (you may assume the user enters the values
in ascending order and that there are no duplicate elements in the
lists).
- You may use the attached ListPM.h
and ListPM.cpp for your list ADT.
- We will discuss testing in class.
Testing should include:
- List1 empty, List2 not empty
- List2 empty, List1 not empty
- Both lists empty
- Bad input values
- List1 = {1, 3, 5, 7} and List2 = {2, 4, 6}
- List1 = {1, 3, 5} and List2 = {6, 7, 8, 9}
- List1 = {1, 2, 3, 7} and List2 = {5, 8, 9}
What to Submit
Name your files:
mergeLists.cpp
script_merge
Turn in your programs
and script to the CS Homework Submission System at https://hopper.csustan.edu/cshomework/
Choose instructor: cs2500mm
Choose course: CS2500
Choose assignment: Lab6