Question
Please help me on all the questions !!!!!!!! Really need help! Will give a thumb up for helping. 1. In the ADT list, new entries
Please help me on all the questions !!!!!!!! Really need help! Will give a thumb up for helping.
1. In the ADT list, new entries are typically added
-
at the end of the list
-
at the beginning of the list in the list
-
at a computed place in the list depending on the number of elements
-
You can add a new entry in a list
-
at the beginning
-
at the end
-
in between items
-
all of the above
-
-
If myList is a declared ADT list and the front of the list is on the left, what does the list look like after applying the following pseudo code?
myList.add(cat) myList.add(dog) mylist.add(fish)
-
cat, dog, fish
-
fish, dog, cat
-
cat, fish, dog
-
dog, fish, cat
-
-
If myList is a declared ADT list and the front of the list is on the left, what does the list look like after applying the following pseudo code?
myList.add(horse) myList.add(goat) myList.add(3, fish) myList.add(1, dog) myList.add(cat)
a. dog, horse, goat, fish, cat b. horse, goat, fish, dog, cat c. cat, horse, goat, fish, dog d. cat, fish, goat, dog, horse
-
Given an ADT list called myList that contains 4 items entries in it, which statement will remove
the first item on the list?
a. myList.remove(1) b. myList.remove() c. myList.removeFront() d. myList.removeFirst()
6. Given an ADT list called myList that contains 4 items entries in it, which statement will add a new item called x on the front of the list?
-
myList.add(1, x)
-
myList.add(x)
-
myList.addFirst(x)
-
myList.addFront(x)
-
Which method is not meaningful for use on an empty list?
-
remove
-
replace
-
getEntry
-
all of the above
-
-
Which method is well behaved when the given position is valid for the current list? a. add
b. remove c. replace d. all of the above
-
In the interface ListInterface, the method public void add(T newEntry);
describes which of the following behaviors? a. adds a new entry to the end of the list b. increases the list size by 1 c. does not affect any other entries on the list d. all of the above
-
In the interface ListInterface, the method public void add(int newPosition, T newEntry);
describes which of the following behaviors? a. adds a new entry at the specified position in the list b. increases the list size by 1 c. moves entries originally at or above the specified position one position higher d. all of the above
-
In the interface ListInterface, the method public void remove(int givenPosition);
describes which of the following behaviors?
-
remove the entry at a given position from the list
-
increases the list size by 1
-
does not affect any other entries on the list
-
all of the above
-
-
If myList is a declared ADT list and the front of the list is on the left, what does the method getEntry(3) return after applying the following pseudo code?
myList.add(horse) myList.add(goat) myList.add(3, fish)
myList.add(1, dog)
myList.add(cat)
-
goat
-
fish
-
cat
-
horse
-
If myList is a declared ADT list and the front of the list is on the left, what does the method getEntry(3) return after applying the following pseudo code?
myList.add(horse) myList.add(goat) myList.add(1, fish) myList.add(cat) myList.add(2, dog) myList.remove(4)
-
horse
-
goat
-
dog
-
cat
-
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