def array_to_queue(queue, source): ------------------------------------------------------- Inserts contents of source into queue. At finish, source is empty. Last
Fantastic news! We've Found the answer you've been seeking!
Question:
def array_to_queue(queue, source): """ ------------------------------------------------------- Inserts contents of source into queue. At finish, source is empty. Last value in source is at rear of queue, first value in source is at front of queue. Use: array_to_queue(queue, source) ------------------------------------------------------- Parameters: queue - a Queue object (Queue) source - a Python list (list) Returns: None ------------------------------------------------------- """ def queue_to_array(queue, target): """ ------------------------------------------------------- Removes contents of queue into target. At finish, queue is empty. Front value of queue is at front of target, rear value of queue is at end of target. Use: queue_to_array(queue, target) ------------------------------------------------------- Parameters: queue - a Queue object (Queue) target - a Python list (list) Returns: None ------------------------------------------------------- """ def queue_test(a): """ ------------------------------------------------------- Tests queue implementation. Tests the methods of Queue are tested for both empty and non-empty queues using the data in a: is_empty, insert, remove, peek, len Use: queue_test(a) ------------------------------------------------------- Parameters: a - list of data (list of ?) Returns: None ------------------------------------------------------- """ q = Queue() # tests for the queue methods go here # print the results of the method calls and verify by hand return
Related Book For
Data Structures and Algorithms in Java
ISBN: 978-1118771334
6th edition
Authors: Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser
Posted Date: