Programming Assignment 2: Deques and Randomized Queues


/* *****************************************************************************
 *  Explain briefly how you implemented Deque.java.
 *  Which data structure did you choose (array, linked list, etc.)?
 *  Why?
 **************************************************************************** */



/* *****************************************************************************
 *  Explain briefly how you implemented RandomizedQueue.java.
 *  Which data structure did you choose (array, linked list, etc.)?
 *  Why?
 **************************************************************************** */



/* *****************************************************************************
 *  How much memory (in bytes) do your data types use to store n items
 *  in the worst case? Use the 64-bit memory cost model from Section
 *  1.4 of the textbook and use tilde notation to simplify your answer.
 *  Briefly justify your answers and show your work.
 *
 *  Do not include the memory for the items themselves (as this
 *  memory is allocated by the client and depends on the item type)
 *  or for any iterators, but do include the memory for the references
 *  to the items (in the underlying array or linked list).
 **************************************************************************** */


Randomized Queue:   ~  _____  bytes



Deque:              ~  _____  bytes



/* *****************************************************************************
 *  List any other comments here. Feel free to provide any feedback   
 *  on how much you learned from doing the assignment, and whether    
 *  you enjoyed doing it.                                             
 **************************************************************************** */
