1. Engineering
  2. Computer Science
  3. please help me on all the questions really need...

Question: please help me on all the questions really need...

Question details

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)

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution