Chat with us, powered by LiveChat CSCI 258 Linked Lists & Comparing Data Structures Project - Credence Writers
+1(978)310-4246 [email protected]

Description

In this lab, you will have 2 tasks. First, extend the OurLinkedList and OurArrayList to implement the interfaces OurStack and OurQueue (note that OurQueue has been modified to rename peek to front). Note that this can be done by calling the methods we already wrote.

Next, you will create a new class with a new main method. In this class, you will time the sequence of operations below for each of the following data structures: LinkedStack (assigned to a variable of type OurStack), ArrayStack (assigned to a variable of type OurStack), ArrayQueue (assigned to a variable of type OurQueue), RingQueue (assigned to a variable of type OurQueue), LinkedQueue (from Lab 2, assigned to a variable of type OurQueue), OurLinkedList (three different times, once each types of OurStack, OurQueue, and OurList), and OurArrayList (three different times, once each types of OurStack, OurQueue, and OurList). Note that you may not modify the data structures or interfaces to do this. You may need to use a second copy of the data structure for temporary storage. In order to time these operations, call both System.currentTimeMillis() and System.nanoTime() before initializing the data structure and again once all tasks are completed. Then subtract the before and after and print the results. Copy those times into a text document, labeled by which data structure it corresponds to (report both milliseconds and nanoseconds for each).

  1. Start by adding 10 elements in any order
  2. Now add an element to the beginning and another element to the end
  3. Now add elements at positions 3, 6, and 9 in that order.
  4. Examine the elements at the beginning and end.
  5. Remove the first and last elements
  6. Remove the elements at positions 4 and 7.
  7. Print all the elements in the data structure.
error: Content is protected !!