D Đ 50% Der Question 6 a) Briefly discuss the significant difference between a priority queue and an ordinary queue. Usi
Posted: Fri May 20, 2022 10:48 am
D Đ 50% Der Question 6 a) Briefly discuss the significant difference between a priority queue and an ordinary queue. Using an everyday example, explain how a priority queue is used an underlying data structure, 8 Major Topic PRIORITY QUEUES Blooms Designation EV Score 7 b) After the following statements execute, what are the contents of the priority queue? PriorityQueue Interface String myPriorityQueue = new LinkedPriorityQueue String 0; myPriority Queue add("a1"); myPriorityQueue.add("a4"); myPriority Queue add("a3"); myPriority Queue add("a2"); String st = myPriority Queue remove(); myPriority Queue add(st); myPrionty Queue add (myPnorityQueue peeko); myPriority Queue add("a2"); myPriority Queue remove(); Initially, assume myPriorityQueue is empty and priority is interpreted as coming first in a lexicographical ordering (dictionary order); Major Topic Blooms Designation Score PRIORITY CR 8 QUEUE c). Compare and contrast the linear search and binary search algorithms by searching for the numbers 45 and 84 in the following list: 3 8 12 34 54 84 91 110 120 Major Topic Blooms Designation Score SEARCHING BINARY