Question: and 1. Each recursive call to a method creates new a. global variables, methods b. parameters, classes c. local variables, classes d. local variables, parameters





and 1. Each recursive call to a method creates new a. global variables, methods b. parameters, classes c. local variables, classes d. local variables, parameters 2. In a linked list, you must have: a. Head and tail pointers b. Head and tail and current pointers c. Tail d. pointer e. Head pointer 3. Which of the following data structures is most appropriate for situations in which you need to access certain data at certain location in constant time? a. an array b. a linked list c. a queue d. a stack e. a priority queue f. none 4. Which of the following statements regarding singly linked lists is true? a. Insert at tail, remove at head and remove at tail can be performed in constant time. b. Insert at head, remove at head and remove at tail can be performed in constant time. C. Insert at head, insert at tail and remove at tail can be performed in constant time. d. Insert at head, insert at tail and remove at head can be performed in constant time. 5. In a simple linked list implementation of a queue, with no tail pointer, where should a new element be inserted to achieve O(1) efficiency? a. At the head b. A the head or at the last node c. At the last node d. It is impossible to achieve 6. In a simple linked list implementation of a queue, with tail pointer, elements are inserted at the head of the linked list, from which end an element should be removed to achieve O(1) efficiency? a. At the head b. A the head or at the last node C. At the last node d. It is impossible to achieve 5. In a simple linked list implementation of a queue, with no tail pointer, where should a new element be inserted to achieve O(1) efficiency? a. At the head b. A the head or at the last node C. At the last node d. It is impossible to achieve 6. In a simple linked list implementation of a queue, with tail pointer, elements are inserted at the head of the linked list, from which end an element should be removed to achieve O(1) efficiency? a. At the head b. A the head or at the last node c. At the last node d. It is impossible to achieve Page 1 of 4 Part 2- What is the right ADT that best matches the situation described FC is a company that delivers food to customers. The company strategy is to deliver food according to the time customers place their orders. However, the delivery boy does not follow that strategy; he delivers food based on distance. The closest customer is served first. The delivery boy reached a neighborhood in which each house has 2 neighbors, one on the left side and the other is on the right side. Some customers in the neighborhood did not like the delivery boy strategy and they called FC customer service. The customer service employee received the complaints from the customers who got their orders late. However, when she gets a complaint, she places it over the previous one. Part 3- For each of the following code fragments, give an analysis of the running time (Big-Oh will do). (Remember, things are not always what they seem) int mystery(int n) int max if (intArray.length > 0) int count = 0; for (int i = 0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
