Implementing Linear Data Structures

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

________ is a data structure to store data in sequential order. A. A List B. A Set C. A Stack D. A Queue

A. A List

As implemented in our textbook: Suppose list1 is a MyArrayList and list2 is a MyLinkedList. Both contains 1 million double values. Analyze the following code: // A: while (list1.size() > 0) list1.remove(0); // B: while (list2.size() > 0) list2.remove(0); A. Code fragment A runs faster than code fragment B. B. Code fragment B runs faster than code fragment A. C. Code fragments A and B should run at about the same speed (based on Big-O analysis). D. Both contain logic errors because they produce infinite loops.

B. Code fragment B runs faster than code fragment A.

As implemented in our textbook: MyLinkedList is more efficient than MyArrayList for the following operations: A. Insert/delete an element in the middle of the list. B. Insert/delete an element in the beginning of the list C. Append an element at the end of the list. D. Retrieve an element at given the index.

B. Insert/delete an element in the beginning of the list

Which data structure is appropriate to store patients seeking COVID-19 Vaccine shots in California in the first quarter of 2021? NOTE: For those that forgot, due to limited availability, healthy people were supposed to wait until those with "underlying medical conditions" got their vaccinations first. Oh... and of course Federal politicians get theirs before everyone! And if you are really paying attention, similar "availability protocols" and in place for Monkey-pox vaccinations. A. Stack B. Queue C. Any List (Array or Link based) D. A Queue implemented as a Heap

D. A Queue implemented as a Heap

As implemented in our textbook: MyArrayList is more efficient than MyLinkedList for the following operations: A. Insert/delete an element in the middle of the list. B. Insert/delete an element in the beginning of the list. C. Append an element at the end of the list. D. Retrieve an element at given the index.

D. Retrieve an element at given the index.


संबंधित स्टडी सेट्स

ALL (that could fit, 2,000 term max)

View Set

Patho Test 1 Ch. 13, 17, 19-21, 24, 46

View Set

sociology chapter 4 self and interaction

View Set

RECITANDO: KEY WORD FORMATION SENTENCES

View Set

Egan's Fundamentails of Respiratory Care Part 3

View Set

DNA Genes and Proteins (Quiz 10)

View Set

Nurs 2300 Midterm1 Patients with hematologic neoplasms

View Set