subject

Let us consider an array a[1...n] with integer values (both positive and negative). Choose three different sorting methods to sort increasingly the array. Which sorting method is the fastest (from the three chosen methods)? Analyze the complexity (problem size, dominant operation and complexity) of the three algorithms in order to prove your answer. (1p) Now that your array a[1...n] is sorted increasingly, consider a value v and using an algorithm with complexity 0(lgn), determine the position where this value can be inserted such that the array remains increasingly sorted. Prove the total correctness of your algorithm (use an invariant). (1p)

Consider another increasingly sorted array b[1...m]. So now you have a[1...n] and b[1...m] with elements not necessarily distinct.

a. Construct a strictly increasingly sorted array with the distinct elements from a and b. Analyze the complexity (problem size, dominant operation and complexity) of your algorithm. (0.5p)

b. Propose an algorithm with linear complexity to determine the set with common elements of the two arrays a and b. Analyze the complexity (problem size, dominant operation and complexity) of your algorithm. (0.5p)

Indications:

All the algorithms will be written in pseudocode.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 11:00
This chapter lists many ways in which becoming computer literate is beneficial. think about what your life will be like once you’re started in your career. what areas of computing will be most important for you to understand? how would an understanding of computer hardware and software you in working from home, working with groups in other countries and contributing your talents.
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
The option enables you to modify a slide element in most presentation applications.
Answers: 2
question
Computers and Technology, 23.06.2019 21:10
Asample of 200 rom computer chips was selected on each of 30 consecutive days, and the number of nonconforming chips on each day was as follows: 8, 19, 27, 17, 38, 18, 4, 27, 9, 22, 30, 17, 14, 23, 15, 14, 12, 20, 13, 18, 14, 20, 9, 27, 30, 13, 10, 19, 12, 26. construct a p chart and examine it for any out-of-control points. (round your answers to four decimal places.)
Answers: 2
You know the right answer?
Let us consider an array a[1...n] with integer values (both positive and negative). Choose three dif...
Questions
Questions on the website: 13722363