A queue can be implemented by using an array and maintaining the current size. The queue elements are stored in consecutive array positions, with the front item always in position 0. Note that this is not the most efficient method. Do the following:
a. Describe the algorithms for getFront, enqueue, and dequeue.
b. What is the Big-Oh running time for each of getFront, enqueue, and dequeue using these algorithms?
c. Write an implementation that uses these algorithms using the protocol in Figure 28.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here