Question: Please help. Thank you. CS310: Data Structures Week 3: Linked Lists Page 1 Your Name: Section: Participation Ouestions 1. Given the Node class definition on

Please help. Thank you.
Please help. Thank you. CS310: Data Structures Week 3: Linked Lists Page
1 Your Name: Section: Participation Ouestions 1. Given the Node class definition

CS310: Data Structures Week 3: Linked Lists Page 1 Your Name: Section: Participation Ouestions 1. Given the Node class definition on the right which of the following are ints i the variable head is a reference to a Node at the start of a linked list 1-2-3? class Node tint value: Node next: b. head.value c. head.next.value d. head, next e head. next next 2. For the same linked list as Question 1 (a->b->c), what is the value of head.next.value? Answer: 3. Given the Node class definition and code snippet on the right, which of the following are null? a. head class Node( T value Node next; } b. head.value c. head.next.value Node head - new Node (); d. head. next head.next = new Node>() e. head.next next 4. Given the Node constructor definition on the right, which statement inserts an item x after node e? a. c.next = new Node (x, c); b. c.next - new Node (x, c.next); C. C new Nodex, C); d. = new Node (x, c.next); e. none of the above public Node Tv, Node n) this.value - V this.next n 5. Suppose we define a static method renovevalt that removes the first half of a List (or slightly less than one-half of the list if odd length) as shown on the right. What can be used to fill the blank? a. only Ist.size() b. only size either ist.size) or size d. neither ist.size() nor size public static void remove aleList Ist) int size - lat.size() for(int 101 121 1++) 1st.remove(0); c 6. Suppose we define a static method totalEventoc() that returns the total of even-index items of an integer List as shown on the right. What is the Big-O running time of the method if ist is a Linkedlist of size N? ist) a. 1) b. O'lg N) & CN. 4 CNN) e ON) public static int totalEventoc (List Integer int sum = 0; for (int i=0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!