Question 4 0 out of 0.75 points D.) The iterator i is after node2 (WRONG) Other
ID: 3862275 • Letter: Q
Question
Question 4
0 out of 0.75 points
D.) The iterator i is after node2 (WRONG)
Other answer choices A.) The interator i is at h. B) The iterator i is at the node2 C) The interator i is at node 1
Question 6
0 out of 0.75 points
Other Answer Choices A)The condition of while (boston.i.has(Next()) gets false, therefore, it skips the while loop, do nothing
B)The output will display all 3 nodes that have inserted to the listWithIterator D)The output will be only node 3 because the iterator i is at node 3 after inserting node 3
Question 7
0 out of 0.75 points
Which is NOT correct for the singly linked list?
D.)There is a unique first node ni and last node nj (WRONG)
Question 9
0 out of 0.75 points
What does the method "public void set (Node newNode)" of the class Iterator do to the SinglyLinkedListIterator structure?
A.)insert the newNode to the location with null after current position of i (Wrong)
Other Answer Choices B) replace the node stored at the iterators current position with a cone of newnode and the iterators position is not changed
C) only move the position of iterator to new position
D) replace the node stored at the iterators current position with a cone of newNode and move the iterations position to next one
Suppose in the main(), we define a Singly Linked List with Iterator:
SinglyLInkedListIterator theList = new SinglyLinkedListIterator(); theList.insert(node1); theList.insert(node2);
where is the location of Iterator i?
D.) The iterator i is after node2 (WRONG)
Other answer choices A.) The interator i is at h. B) The iterator i is at the node2 C) The interator i is at node 1
Question 6
0 out of 0.75 points
In the main()
SinglyLinkedListIterator listWithIterator = new SinglyLinkedListIterator();
listWithIterator.insert(node1);
listWithIterator.insert(node2);
listWithIterator.insert(node3);
while (boston.i.hasNext())
System.out.println(listWithIterator.i.next());
What is the output?Selected Answer: C.)The output will be nothing because it displays the information of the node after node3 and it is null (Wrong)
Other Answer Choices A)The condition of while (boston.i.has(Next()) gets false, therefore, it skips the while loop, do nothing
B)The output will display all 3 nodes that have inserted to the listWithIterator D)The output will be only node 3 because the iterator i is at node 3 after inserting node 3
Question 7
0 out of 0.75 points
Which is NOT correct for the singly linked list?
Selected Answer:D.)There is a unique first node ni and last node nj (WRONG)
Other Answer Choices A) Any other node nk can be proceeded by more than one node B) The Node form a linear list C) Each node has one link fieldQuestion 9
0 out of 0.75 points
What does the method "public void set (Node newNode)" of the class Iterator do to the SinglyLinkedListIterator structure?
Selected Answer:A.)insert the newNode to the location with null after current position of i (Wrong)
Other Answer Choices B) replace the node stored at the iterators current position with a cone of newnode and the iterators position is not changed
C) only move the position of iterator to new position
D) replace the node stored at the iterators current position with a cone of newNode and move the iterations position to next one
Explanation / Answer
Answer 4 )
B) The iterator i is at the node2
Answer 6 )
A)The condition of while (boston.i.has(Next()) gets false, therefore, it skips the while loop, do nothing
Answer 7 )
C) Each node has one link field
Answer 9 )
B) replace the node stored at the iterators current position with a cone of newnode and the iterators position is not changed
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.