Chapters 15-17 Reading Assignment

Abstract data types linked list, stack and queue are cover in chapters 16 and 17. Section 15.1 cover exceptions. BTW, you're only responsible for the sections covered in this assignment on the Final Exam.


Section 16.1 - Linked list ADT

What advantage does a linked list have over an array? Over a vector?

Why is a linked list called a self-referential data structure?

Section 16.2 - Linked list operations

Please draw diagrams of each of the following linked list operations for 1) an empty list, 2) a list with 1 node, and 3) a list with n nodes:

Section 16.4 - Variations of the linked list

What is the difference between a singly linked list and doubly linked list?

What distinguishes a circular linked list?


Section 17.1 & 17.2 - Stack ADT

Define LIFO. Why are stacks considered LIFO structures?

What is the difference between a static stack and a dynamic stack implementation? What errors can occur with a static implementation that won't happen with a dynamic implementation?

What do the push and pop functions do to a stack?

Section 17.4 & 17.5 - Queue ADT

Define FIFO. What are queues considered FIFO structures?

What is a circular array and how does it impact the implementation of a queue.

What do the enqueue and dequeue functions do to a queue?

Please answer questions 17.15-17.18, the diagrams showing static implementations of a stack and a queue. Please note: if you have an old book and these exercises aren't there, then we'll work on them in class.


Section 15.1 - Exceptions

What is the purpose of exceptions in C++?

Define the three keywords in C++ that are related to exceptions.

How many try blocks can a program have? How many catch blocks can be associated with a try block?

What happens if an exception is not caught?

Define a class Example with two exceptions classes TooFilling and TastesBad. Add a function called beverage() that throws an exception using each class. Then write a pretend main() that catches each exception.