Question: arr 0 Question 2 (1 x 13 = 13 marks) Consider your ID as an array of 9 elements. Example ID: 201710340 2 0 0
arr 0 Question 2 (1 x 13 = 13 marks) Consider your ID as an array of 9 elements. Example ID: 201710340 2 0 0 1 Consider a Circular Queue implemented using an array of length 6. Show the contents of the queue after executing each of the following segments of code in order. a) 4. enqueue (arr[@]); 4. enqueue (arr[1]); 9.enqueue (arr[2]); q.enqueue (arr[3]); b) q.dequeue(); 9.dequeue(); c) 4. enqueue (arr[4]); q.enqueue (arr[5]); 9.enqueue (arr[6]); = 9 d) What is the output of the following statements? System.out.println(q.size()); System.out.println(q.first()); e) Explain what will happen after after executing the following statements. 9.enqueue (arr[7]); q.enqueue (arr[8]); f) What is the performance (in Big-O notation) of each of the previous methods? Explain
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
