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

can you please answer D, B and C Please the code part i already did it thanks D.

ID: 3700807 • Letter: C

Question

can you please answer D, B and C Please the code part i already did it thanks

D. -2 points Suppose you want to find the largest entry in an unsorted array of n entries. Algorithm A searches the entire array sequentially and records the largest entry seen so far. Algorithm The array is initially B sorts the array into descending order and then reports the first entry as the largest. Compare the time efficiency of the two approaches. 1 2 3 4 5 E. -10 pointsConsider ann by n array of integer values. Write an 2 3 1 4 5 algorithm to sort the rows of the array by their first value Implement your algorithm The code for this problem is provided in the Assignment-03-Code.zip archive The array after sorting is 2 3 1 4 5 Your output must be identical to the output to the right. 5 2 3 4 1 PART 2 -Queues, Deques, and Priority Queues, 19 points A. -3 pointsAfter the following statements execute, what are the contents of the queue? Queuelnterface myQueue new LinkedQueue) myQueue.enqueue("Jane"); myQueue.enqueue(Jess") myQueue.enqueue("jill"); myQueue.enqueue(myQueue.dequeue()) myQueue.enqueue(myQueue.getFront() myQueue.enqueue("Jim"); String name myQueue.dequeue() myQueue.enqueue(myQueue.getFront() Updated: 3/7/2018 12:10 PM CSC 220.02 ASSIGNMENT 03 SPRING 2018TA B. -3 points After the following statements execute, C. -3 pointsAfter the following statements execute what are the contents of the queue? what are the contents of the priority queue? Assume that the alphabetically earliest string has the highest priority Dequelnterface myDeque new LinkedDeque( myDeque.addToFront("Jim"); myDeque.addToFront("Jess"); myDeque.addToBack("Jill"); myDeque.addToBack Jane"); String name myDeque.removeFront(); myDeque.addToBack(name); myDeque.addToBack(myDeque.getFront()) myDeque.addToFront(myDeque.removeBack()); myDeque.addToFront(myDeque.getBack()); PriorityQueuelnterface myPriorityQueue - new LinkedPriorityQueue>); myPriorityQueue.add("Jim"); myPriorityQueue.add( Jess"); myPriorityQueue.add(Jill"); myPriorityQueue.add("Jane"); String name myPriorityQueue.remove( myPriorityQueue.add(name) myPriorityQueue.add(myPriorityQueue.peek()) myPriorityQueue.add("Jim"); myPriorityQueue.remove() D. -10 pointsUse a circular doubly linked chain to implement the ADT deque In a doubly linked chain, the first and last nodes each Create a deque:

Explanation / Answer

D. The first algorithm coplexity is O(n). This is because in this we are traversing the whole
array , considering each element for updating the maximum. The second algorithm is first
sorting the array elements and then giving the first element.The complexity depends upon how
sorting is done because after that reporting the maximum is O(1).There are various startegies for
sorting whose complexity ranges from O(nlogn) to O(n^2).

B . The Dequeue is as follows:

   Jess(H) Jim(H) Jim(H) Jill(T) Jane(T) Jess(T)    (H- head(front) T -tail(back) )

C The priority queue is as follows:

(H)Jane Jess Jill Jim Jim

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote