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

6. To locate a node within a chain that is near the end of the lis e must a. sta

ID: 3911519 • Letter: 6

Question

6. To locate a node within a chain that is near the end of the lis e must a. start at the last node and traverse the chai b. start at the first node and traverse the chain c. directly access the node. d. none of the above. 7. in the linked implemention of a list, th publc void add( T newEntry) insert a new entry a. at the beginning of the lis b. at the end of the list. c. between adjacent nodes of the list. d. all of the abov in a linked implementation of a list with a tail reference, removing are make tail null reference a. the list is empty b. the listis full c. the list only contains one entry d. the above. 9 In a inked-based implementation of the ADT list with only a head reference erformance of adding an entry at the end of the list? . O(n) b. ?(n) C. O(log n)

Explanation / Answer

1)To locate a node with in a chain that is near the end of the list we must

Answer: A
a)start at the last node and traverse the chain

Explanation:
we should start at the last node and traverse the chain because by traverse the chain we can easily identify the node with in a chain that is near the end.but if we start at the first node it need to be done lot of iterations.

2)In the linked implementatin of a list, the add method.
public void add(T newEntry)
insert a new entry

Answer: A
a)at the begining of the list

explanation:
------------
public void add(String item)
{
if(curr != null)
{
Node newNode = new Node(item, curr.next);
curr.next = newNode;
curr = newNode;
}
else
{
head = tail = new Node(item, null);
curr = head;
}
}


3)In a linked implementatin of a list with a trail reference, removing are make tail null reference if the list only contains one entry.

Answer:C

explanation:
-----------
Removing are make tail null reference is only be done when the list only contains one entry.

4)In a linked- based implementation of the ADT list with only a head reference performance of adding an entry at the end of the list.

Answer:D) O(1).

Thanka have a great day.