Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me on all the questions !!!!!!!! Really need help! Will give a thumb up for helping. In an array-based implementation of the ADT

Please help me on all the questions !!!!!!!! Really need help! Will give a thumb up for helping.

  1. In an array-based implementation of the ADT list, what is the best case performance of the ensureCapacity method?

    1. O(1)

    2. O(log n)

    3. O(n)

    4. O(n2)

  2. In an array-based implementation of the ADT list, what is the worst case performance of the ensureCapacity method?

    1. O(n)

    2. O(n2)

    3. O(log n)

    4. O(1)

  3. 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)

10. 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?

  1. O(1)

  2. O(log n)

  3. O(n)

  4. O(n2)

  1. In an array-based implementation of the ADT list, the getEntry method locates the entry by

    1. going directly to the appropriate array element

    2. searching for the entry starting at the beginning of the array working to the end

    3. searching for the entry starting at the end of the array working to the beginning

    4. none of the above

  2. In an array-based implementation of the ADT list, the contains method locates the entry by

    1. searching for the entry starting at the beginning of the array working to the end

    2. searching for the entry starting at the end of the array working to the beginning

    3. going directly to the appropriate array element

    4. none of the above

  3. In an array-based implementation of the ADT list, the makeRoom method does the most work when

a. newPosition is 1

  1. newPosition is n

  2. newPosition is n/2

  3. newPosition is n-1

  1. In an array-based implementation of the ADT list, what is the best case performance of the makeRoom method?

    1. O(1)

    2. O(log n)

    3. O(n)

    4. O(n2)

9. 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?

  1. O(n)

  2. O(n2)

  3. O(log n)

  4. O(1)

  1. 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

2. 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

  1. In an array-based implementation of the ADT list, what is the best case performance of the replace method?

    1. O(1)

    2. O(log n)

    3. O(n)

    4. O(n2)

  2. In an array-based implementation of the ADT list, what is the worst case performance of the replace method?

    1. O(1)

    2. O(log n)

    3. O(n)

    4. O(n2)

  3. In an array-based implementation of the ADT list, what is the best case performance of the getEntry?

    1. O(1)

    2. O(log n)

    3. O(n)

    4. O(n2)

  4. In an array-based implementation of the ADT list, what is the worst case performance of the getEntry method?

    1. O(1)

    2. O(log n)

    3. O(n)

    4. O(n2)

  5. In an array-based implementation of the ADT list, what is the best case performance of the contains method?

    1. O(1)

    2. O(log n)

    3. O(n)

    4. O(n2)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions

Question

Consider this article:...

Answered: 1 week ago