CIS 22B - Notes for Mon Nov 27

Announcements and Reminders

Linked List

A linked list is a data storage technique that allows for variable size container.  Linked lists typically consists “connected” nodes containing both data and one or more pointers.  The pointer(s) perform the connection to the “next” data item.  Common types of linked lists are single-ended (containing data and one next pointer) and double-ended (containing data and two pointers, next and previous).  A linked list contrainer is implemented in the C++ STL.


This is a multi-file solution

A multiple file application - demonstration

Source Files

Standard Template Library (STL)

vector - dynamic array container

list - bidirectional linear container

stack - last-in, first-out (LIFO) adapter

queue - first-in, first-out (FIFO) adapter

The STL solution

Lab Exercise #10

Put your name, the compiler used, and Lab Exercise #10 in a comment at the top of your program. Email your source code. This lab exercise is due at the beginning of the next lecture.  You may email your lab solution prior to that.  

Add a remove_last() function to the List class that was presented in the multi-file solution.  This function should remove the last node (element) in your linked list.  Solve this as a multi-file solution. 

Here are the files needed for this exercise.

Email only the definition of your remove_last() function.