Week 2 : Linked Lists – Quiz
1. (TCO 2) In a linked list, every node contains a(n) _____. (Points : 3)
reference to the next node in the list
reference to the last node of the list
reference to the first node of the list
array
2. (TCO 2) A _____ can always be traversed in the backward direction. (Points : 3)
linked list
doubly linked list
linked list with a header dummy node
linked list with a trailer node
3. (TCO 2) A doubly linked list can be traversed in the _____ direction(s). (Points : 3)
forward
backward
forward and backward
circular
4. (TCO 2) In each node of a circular linked list, we use _____. (Points : 3)
a next field
the null value
a previous field
a next field and a previous field
5. (TCO 2) The following class framework corresponds to the class _____.
public class ClassName
{
private Node first;
public ClassName(){…}
public boolean isEmpty(){…}
public void display(){…}
public void add(int i){…}
public void remove(int x){…}
} (Points : 3)
node
arrayBag
arrayList
linkedList
6. (TCO 2) Which linked list operation does the operation method below define?
public void operation()
{
Node current = first.getNext();
while (current != null)
{
System.out.print(current.getInfo() + ” “);
current = current.getNext();
}
System.out.println();
} (Points : 3)
It initializes the linked list.
It determines if the list is empty.
It inserts an element in the linked list.
It displays the list elements.
7. (TCO 2) Which linked list operation does the operation method below define?
public void operation(int item)
{
Node newListNode = new Node();
newListNode.setInfo(item);
newListNode.setNext(first.getNext());
first.setNext(newListNode);
} (Points : 3)
It displays the list elements.
It finds if item is contained in the linked list.
It inserts item in the linked list.
It removes item from the linked list.
8. (TCO 2) Suppose that the method below is one of the methods in a LinkedList class. Which does the method return?
public int operation()
{
Node current = first.getNext();
int value = 0;
while(current != null)
{
value++;
current = current.getNext();
}
return value;
} (Points : 3)
The sum of all list elements
The smallest element in the list
The greatest element in the list
The number of elements in the list
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at [email protected].
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at [email protected] and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at [email protected].
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************
Any personal information received will only be used to fill your order. We will not sell or redistribute your information to anyone.
We will try our best to resolve the issue and if still persists we can discuss for a refund in case its required.