Logo Data Structures and Algorithms with Object-Oriented Design Patterns in C++
next up previous contents index

Linked List Implementation

Program gif defines a linked-list implementation of a deque. The DequeAsLinkedList class is defined using multiple inheritance: It is derived from both the Deque abstract base class and the QueueAsLinkedList linked-list implementation of a queue. The Deque class provides the interface; the QueueAsLinkedList, the implementation.

   program8523
Program: DequeAsLinkedList Class Definition

The QueueAsLinkedList implementation provides almost all of the required functionality. For example, Program gif shows that the Head, EnqueueTail and DequeueHead operations of the DequeAsLinkedList class are implemented by calling the appropriate QueueAsLinkedList class operations.

   program8539
Program: DequeAsLinkedList Class Head, EnqueueHead and DequeueHead Member Function Definitions




next up previous contents index

Bruno Copyright © 1997 by Bruno R. Preiss, P.Eng. All rights reserved.