Question
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.
-
In an array-based implementation of the ADT list, what is the best case performance of the ensureCapacity method?
-
O(1)
-
O(log n)
-
O(n)
-
O(n2)
-
-
In an array-based implementation of the ADT list, what is the worst case performance of the ensureCapacity method?
-
O(n)
-
O(n2)
-
O(log n)
-
O(1)
-
-
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?
-
O(1)
-
O(log n)
-
O(n)
-
O(n2)
-
In an array-based implementation of the ADT list, the getEntry method locates the entry by
-
going directly to the appropriate array element
-
searching for the entry starting at the beginning of the array working to the end
-
searching for the entry starting at the end of the array working to the beginning
-
none of the above
-
-
In an array-based implementation of the ADT list, the contains method locates the entry by
-
searching for the entry starting at the beginning of the array working to the end
-
searching for the entry starting at the end of the array working to the beginning
-
going directly to the appropriate array element
-
none of the above
-
-
In an array-based implementation of the ADT list, the makeRoom method does the most work when
a. newPosition is 1
-
newPosition is n
-
newPosition is n/2
-
newPosition is n-1
-
In an array-based implementation of the ADT list, what is the best case performance of the makeRoom method?
-
O(1)
-
O(log n)
-
O(n)
-
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?
-
O(n)
-
O(n2)
-
O(log n)
-
O(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
-
In an array-based implementation of the ADT list, what is the best case performance of the replace method?
-
O(1)
-
O(log n)
-
O(n)
-
O(n2)
-
-
In an array-based implementation of the ADT list, what is the worst case performance of the replace method?
-
O(1)
-
O(log n)
-
O(n)
-
O(n2)
-
-
In an array-based implementation of the ADT list, what is the best case performance of the getEntry?
-
O(1)
-
O(log n)
-
O(n)
-
O(n2)
-
-
In an array-based implementation of the ADT list, what is the worst case performance of the getEntry method?
-
O(1)
-
O(log n)
-
O(n)
-
O(n2)
-
-
In an array-based implementation of the ADT list, what is the best case performance of the contains method?
-
O(1)
-
O(log n)
-
O(n)
-
O(n2)
-
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started