Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 110 pts If myList is a declared ADT list and the front of the list is o

ID: 3803619 • Letter: Q

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 after applying the following pseudo code?

myList.add(“Tom”)
myList.add(“Hank”)
myList.add(3, “Ryan”)
myList.add(1, “Sally”)
myList.add(“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”)

Flag this Question

Question 310 pts

You can add a new entry in a list

Flag this Question

Question 410 pts

Using the method add(newEntry) of the array-based implementation of the ADT list, newEntry is placed

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

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?

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?

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?

Flag this Question

Question 910 pts

Including a tail reference to a linked implementation of a list makes which functionality more efficient?

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?

Tom Sally Hank Ryan Helen

Explanation / Answer

Multiple Questions : Answering four

Question 3:

Ans : all of the above

Reason : New entry can be anywhere in the list

Question 4:

Ans : immediately after the last occupied position

Reason : After the last occupied position in the array

Question 9 :

Ans : adding a node to the end of a list

Reason : Tail reference is good for any operations at the end of the list

Question 10 :

Ans : O(n)

Reason : Need to traverse from head to last element

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote