Queues - PowerPoint PPT Presentation

About This Presentation
Title:

Queues

Description:

Queues. A first-in, first-out or FIFO data structure. Basic ... Double-ended queue. Insert and remove items at both ends of the pile. Basic Operations ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 24
Provided by: scie218
Category:
Tags: double | ended | queues

less

Transcript and Presenter's Notes

Title: Queues


1
Queues
  • A first-in, first-out or FIFO data structure.
  • Basic operations enqueue, Dequeue and Head.

2
Implementation
  • Array based
  • Pointer based (using linked list)

3
Basic Queue Operations
4
Queue Class Definition
5
Array Implementation
6
Array Implementation of a queue
7
Constructor, Destructor and Purge()
8
Head, Enqueue, and Dequeue
9
Linked-List Implementation
10
Constructor, Destructor and Purge()
11
Head, Enqueue and Dequeue
12
Deques
  • Double-ended queue.
  • Insert and remove items at both ends of the pile.

13
Basic Operations
14
Deque Class Definition
15
Enqueue and Dequeue
16
Specialization and Generalization
  • Specialization
  • Base class is general, derived class is
    restricted.
  • class Queue public Deque
  • Generalization
  • Base class is restricted, derived class is
    general.
  • class Deque public Queue

17
Array Implementation
18
Head(), EnqueueHead(), DequeueHead()
19
Tail(), EnqueueTail() DequeueTail()
20
Linked-List Implementation
21
Head(), EnqueueHead() and DequeueHead()
22
Tail() EnqueueTail() and DequeueTail()
23
Doubly-Linked and Circular Lists
Write a Comment
User Comments (0)
About PowerShow.com