Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

image text in transcribed

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions

Question

2. What are implementation intentions?

Answered: 1 week ago

Question

Identify four applications of HRM to healthcare organizations.

Answered: 1 week ago