# HOMEWORK 1

## CMSC 420, Section 0101, Spring 2002

**Due: Feb. 7, 2002**

** **

You are required to manage
insertions and deletions into a set of K queues Q_{1},..,Q_{K}
using a fixed length array A[1,..,K].

- (4 points) Describe the data structures you
would use for this problem. Explain how these data structures are
initialized and what your conventions are for a FULL queue and an EMPTY
queue.
- (10 points) Write, in pseudocode, an algorithm
called
*insert(value,I) *which inserts a value into queue Q_{I}.
Your algorithm should handle overflows, and where appropriate, it should
reorganize the location of queues in A.
- (6 points) Write, in pseudocode, an algorithm
called
*delete(I) *which deletes the element at the front of queue Q_{I}.
Your algorithm should report an underflow error if Q_{I} is emty.