Data Structures - Quiz 1 List Implementation

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

In an array-based implementation of the ADT list, entries must be ordered alphabetically.

False

In an array-based implementation of the ADT list, the makeRoom method does the most work when newPosition is n

False

Methods in a vector based implementation of the ADT list have different specifications than methods in an array based implementation of the ADT list

False

When you use a vector to implement the ADT list, retrieving an entry at a given position is slow.

False

When you use an array to implement the ADT list, retrieving an entry at a given position is slow

False

In an array-based implementation of the ADT list, entries must be ordered numerically

True

In the makeRoom method of the array-based implementation of the ADT list, it is possible that no items will be shifted.

True

Methods in a vector based implementation of the ADT list are functionally similar to methods in an array based implementation of the ADT list.

True

The ADT list specifies the order of the entries

True

When you use a vector to implement the ADT list, adding an entry at a the end of the list is fast.

True

When you use an array to implement the ADT list, adding an entry at a the end of the list is fast

True

A new entry is added to an array-based implementation of the ADT list a. immediately after the last occupied position b. immediately before the first occupied position c. in the last array position d. in the location returned by the new operator

A

An array provides _______ access to its elements. a. direct b. random c. sequential d. none of the above

A

In an array-based implementation of the ADT list, the contains method locates the entry by a. searching for the entry starting at the beginning of the array working to the end b. searching for the entry starting at the end of the array working to the beginning c. going directly to the appropriate array element d. none of the above

A

In an array-based implementation of the ADT list, the getEntry method locates the entry by a. going directly to the appropriate array element b. searching for the entry starting at the beginning of the array working to the end c. searching for the entry starting at the end of the array working to the beginning d. none of the above

A

In an array-based implementation of the ADT list, the makeRoom method does the most work when a. newPosition is 1 b. newPosition is n c. newPosition is n/2 d. newPosition is n-1

A

In an array-based implementation of the ADT list, what is the best case performance of the contains method? a. O(1) b. O(log n) c. O(n) d. O(n2 )

A

In an array-based implementation of the ADT list, what is the best case performance of the ensureCapacity method? a. O(1) b. O(log n) c. O(n) d. O(n2 )

A

In an array-based implementation of the ADT list, what is the best case performance of the getEntry? a. O(1) b. O(log n) c. O(n) d. O(n2 )

A

In an array-based implementation of the ADT list, what is the best case performance of the makeRoom method? a. O(1) b. O(log n) c. O(n) d. O(n2 )

A

In an array-based implementation of the ADT list, what is the best case performance of the remove method? a. O(1) b. O(log n) c. O(n) d. O(n2 )

A

In an array-based implementation of the ADT list, what is the best case performance of the replace method? a. O(1) b. O(log n) c. O(n) d. O(n2

A

In an array-based implementation of the ADT list, what is the performance of adding an entry at the end of the list if you amortize the cost of resizing the array over all additions to the list? a. O(1) b. O(log n) c. O(n) d. O(n2

A

In an array-based implementation of the ADT list, what is the performance of adding an entry at the end of the list when the array is not resized? a. O(1) b. O(log n) c. O(n) d. O(n2 )

A

In an array-based implementation of the ADT list, what is the performance of adding an entry at the end of the list when the array is resized? a. O(n) b. O(n 2 ) c. O(log n) d. O(1)

A

In an array-based implementation of the ADT list, what is the performance of the contains method when the entry is not in the list? a. O(n) b. O(n2 ) c. O(log n) d. O(1)

A

In an array-based implementation of the ADT list, what is the worst case performance of the contains method? a. O(n) b. O(n2 ) c. O(log n) d. O(1)

A

In an array-based implementation of the ADT list, what is the worst case performance of the ensureCapacity method? a. O(n) b. O(n2 ) c. O(log n) d. O(1)

A

In an array-based implementation of the ADT list, what is the worst case performance of the getEntry method? a. O(1) b. O(log n) c. O(n) d. O(n2 )

A

In an array-based implementation of the ADT list, what is the worst case performance of the makeRoom method? a. O(n) b. O(n2 ) c. O(log n) d. O(1)

A

In an array-based implementation of the ADT list, what is the worst case performance of the remove method? a. O(n) b. O(n2 ) c. O(log n) d. O(1)

A

In an array-based implementation of the ADT list, what is the worst case performance of the replace method? a. O(1) b. O(log n) c. O(n) d. O(n2 )

A

In the array-based implementation of the ADT list, the removeGap method a. moves each entry to its next lower position b. moves each entry to its next higher position c. swaps the first entry with the specified entry to remove d. swaps the last entry with the specified entry to remove

A

In the makeRoom method of an array-based implementation of the ADT list a. entries are shifted toward the end of the array beginning with the last entry b. entries are shifted toward the beginning of the array beginning with the last entry c. entries are shifted toward the beginning of the array beginning with the first entry d. entries are shifted toward the end of the array beginning with the first entry

A

In the makeRoom method of an array-based implementation of the ADT list no shift is necessary if a new entry is to be placed at a. numberOfEntries + 1 b. numberOfEntries - 1 c. numberOfEntries d. none of the above

A

When adding an entry to an array-based implementation of the ADT list at a specified location before the end of the list a. entries must be shifted to vacate a position for the new item b. no shift is necessary c. a new entry must be allocated and linked to attach the new item d. the entry at the specified location will be overwritten by the new item

A

When adding an entry to an array-based implementation of the ADT list at the end of the list a. no shift is necessary b. all of the previous elements must be shifted toward the front of the array c. only one element is shifted toward the end of the array to make room d. only one element is shifted toward the beginning of the array to make room

A

When deleting an entry from an array-based implementation of the ADT list at the end of the list a. no shift is necessary b. all of the previous elements must be shifted toward the front of the array c. only one element is shifted toward the end of the array to close the gap d. only one element is shifted toward the beginning of the array to close the gap

A


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

Social, Economic and Political Effects of Migration

View Set

Sports Society Chapter 1: What is Sport and Why do we Study it?

View Set

AGEC 1003 Fannin Final Exam Review Questions

View Set

Help Desk Final (Chapter 1 - 11) Multiple Choice

View Set

California Real Estate Chapter 7

View Set