CS 14 - Lab 1


CS 14 Homepage

Simple Linked Lists

This lab is designed to give you a refresher on pointers and experience with a very simplified linked list of integers.

Most importantly, this lab is designed to teach you how to conform with a given specification for a design. In this lab, I am giving you a skeleton of the code and the function prototypes. I am also giving you a main function that will test the functionality of you code. It is very important that the code that you write works with the main function that I provide you with. The majority of future lab assignments and home programming assignments will follow the same format. This does not mean that you should not write your own main function and test cases to test your code. You should try to test your code on your own and then make sure that it works with the main function provided.

The Assignment

You will implement a simple linked list of integers and four operations on the list: size, push_front, push_back, and print. You will begin with the skeleton code provided. DO NOT make any changes to the code given to you. You will only add code to the skeleton code.

List Functions

You will implement the following list functions. The specifications for each list function is listed below. Please use the function declarations exactly as they are listed because if you change them, your code will not interface correctly with the main test function.

Procedure

1. Sign up for the class mailing list here.
2. Carefully read and sign the 2 academic dishonesty handouts in lab. Please completely fill out the information at the bottom of each handout and return them to your TA.
3. Download the code provided above.
4. Compile the code using "g++ -Wall -W -Werror -pedantic main.cc list.cc"
5. Insert the code for the functions that you will need to implement. Test your program.
6. When your program is working correctly with the main.cc file provided, raise your hand to be checked out. If it is getting towards the end of the lab period, make sure you get checked out for what you currently have working. Partial credit is much better than no credit at all.
7. You MUST turn in your code electronically to receive credit for the lab. Make sure your name and partners name is on the code and turn it in. Please only have one turnin for each group (only turn the code in from one account). The code is due 1 hour after the end of the lab period (as it will be every week). Make sure to turn it in to the correct section.

Point Breakdown

© 2003 UC Riverside Department of Computer Science & Engineering. All rights reserved.