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

cose 2436 Piease eirele your anavere en 1. What is Big-o notation used for? (b)

ID: 3747051 • Letter: C

Question

cose 2436 Piease eirele your anavere en 1. What is Big-o notation used for? (b) shows the maximum data set size (d) shows the growth of an algorithm given the data (a) shows the minimum data set size Ic) shows an alternative algorithm 2. Our recursive algorithm to calculate (a) 1 the Fibonacci number series is the most efficient algorithm (b) O 3. The merge sort is recursive. (a) 1 (b) O 4. (a) The ArrayList is dynamic 1 (b) 0 Arraylist Code ArrayListdtring»Stuff-new ArrayListest ring) stuff.add ("apple") Stuff.add ("ba Stuff.add ("cucumber") a Stuff . add (0,"Spam"); . con" Stuff.remove (2) 5. Using the ArrayList Code, what will the following output? System.out.printin(stufE.get (o)) (a) apple (b) bacon )cucumber (d) Spam 6. Using the ArrayList Code, what will the following output? System.out.printin (Stuft.sizet) (a) 1 (b) 2 (c) 3 (d) 4 7. Using the ArrayList Code, how do you change "cucumber" to "carrot"? (a) Stuff.set (0, "carrot") (b) Stuff.set (1, "carrot" (c) Stuff.set 12, "carrot")(d) Stuff.set (3, carrot" 8. How would you declare a new ArrayList to store the cash balance of bank checking acco (a) ArrayList Balance new ArrayList (b) ArrayListcInteger> Balance new ArrayList (c) int Balance new ArrayList (Integer) (d) double Balance new ArrayList (Double): 9. Which sorts) have the Big-O growth of On')?(a) Bubble (b) Selection

Explanation / Answer

1. d. it shows growth of algorithm data.
2. Recursive algo is not the most efficient. b) 0
3. a. 1. Yes, the merge sort is recursive.
4. a. 1. Yes, the array list is dynamic, as it increases its size as per need.
5. d. Spam, as Spam has been inserted at index0 and has not been then removed.
6. c) 3, the size will be 3, as there are 4 insertion and one deletion.
7. c) Stuff.set(2, "carrot"), as cucumbar is on 3rd position, which means 2nd index.
8 a) it should be a arraylist of doubles, as bank balances may involve decimals.
9 b) selection sort has O(n2) complexity.