Question
Question 110 pts If myList is a declared ADT list and the front of the list is on the left, the contents of the list
Question 110 pts
If myList is a declared ADT list and the front of the list is on the left, the contents of the list after applying the following pseudo code?
myList.add(Tom) myList.add(Hank) myList.add(3, Ryan) myList.add(1, Sally) myList.add(Helen)
Tom Sally Hank Ryan Helen |
Sally Ryan Tom Helen Hank |
Ryan Helen Tom Hank Sally |
Sally Tom Hank Ryan Helen |
Flag this Question
Question 210 pts
If myList is a declared ADT list and the front of the list is on the left, show the contents of the list after applying the following pseudo code?
myList.add(horse) myList.add(goat) myList.add(1, fish) myList.add(cat) myList.remove(2) myList.add(3, dog) myList.replace(2, frog)
horse frog dog cat |
fish frog dog cat |
horse fish frog dog |
frog horse dog fish |
Flag this Question
Question 310 pts
You can add a new entry in a list
at the beginning |
at the end |
in between items |
all of the above |
Flag this Question
Question 410 pts
Using the method add(newEntry) of the array-based implementation of the ADT list, newEntry is placed
immediately after the last occupied position |
immediately before the first occupied position |
in the last array position |
in the location returned by the new operator |
Flag this Question
Question 510 pts
In the makeRoom(newPosition) method of an array-based implementation of the ADT list no shift is necessary if newPosition is equal to
numberOfEntries 1 |
numberOfEntries |
numberOfEntries +1 |
none of the above |
Flag this Question
Question 610 pts
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?
O(1) |
O(log n) |
O(n) |
O(n^2) |
Flag this Question
Question 710 pts
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(n^2) |
Flag this Question
Question 810 pts
In an array-based implementation of the ADT list, what is the worst case performance of the remove method?
O(1) |
O(log n) |
O(n) |
O(n^2) |
Flag this Question
Question 910 pts
Including a tail reference to a linked implementation of a list makes which functionality more efficient?
searching for a node on the list |
adding a node to the end of a list |
removing a node from the list |
all of the above |
Flag this Question
Question 1010 pts
In a linked-based implementation of the ADT list with only a head reference, what is the performance of removing an entry at the end of the list?
O(log n ) |
O(1) |
O(n) |
O(n^2) |
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