subject

Given an unsorted array of distinct integers numbers and is given a non-negative integer number, k, k < n. you need to find an element from a such that its rank is k, i. e., there are exactly (k-1) numbers less than or equal to that element. example: input: a = [1, -3, 4, 3, 12, 20, 30, 7, 14, -1, 0] and k =8. output: 12, since 7, -3, -1, 0, 4, 3, 1 (8-1=7 numbers) are all less than or equal to 12 suggest a sub-quadratic running time complexity algorithm (only pseudo-code) to solve this problem. justify. (b) given an array a of n + m elements. it is know that the first n elements in a are sorted and the last m elements in a are unsorted. suggest an algorithm (only pseudo code) to sort a in o(mlogm +n) worst case running time complexity. justify. (c) the processing time of an algorithm is described by the following recurrence equation (c is a positive constant): t(n) = 3t(n/3) + 2cn; t(1) = 0 what is the running time complexity of this algorithm? justify. (d) you decided to improve insertion sort by using binary search to find the position p where the new insertion should take place. (d.1) what is the worst-case complexity of your improved insertion sort if you take account of only the comparisons made by the binary search? (d.2) what is the worst-case complexity of your improved insertion sort if only swaps/inversions of the data values are taken into account?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:10
Write an application that allows a user to enter the names and birthdates of up to 10 friends. continue to prompt the user for names and birthdates until the user enters the sentinel value “zzz” for a name or has entered 10 names, whichever comes first. when the user is finished entering names, produce a count of how many names were entered, and then display the names. in a loop, continuously ask the user to type one of the names and display the corresponding birthdate or an error message if the name has not been previously entered. the loop continues until the user enters “zzz” for a name. save the application as birthdayreminder.java.
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
Why would a business likely use a java applet - to back up their data files for the business - to create a program that a customer can launch in their web browser - to create music on a powerpoint presentation - to organize files on their company directory
Answers: 3
question
Computers and Technology, 25.06.2019 04:00
Has anyone noticed that has been giving the wrong answers and that the ads are blocking answers or is that just me?
Answers: 2
question
Computers and Technology, 25.06.2019 09:00
What do students buy when they pay tuition? o a place to live at a school o the right to attend classes at a school o transportation expenses to attend classes o textbooks
Answers: 2
You know the right answer?
Given an unsorted array of distinct integers numbers and is given a non-negative integer number, k,...
Questions
question
Mathematics, 11.11.2020 17:30
Questions on the website: 13722363