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, 22.06.2019 17:00
Your company has 1,500 desktop computers running windows 7. you want to upgrade them to windows 10. which type of microsoft license would be best suited in this situation?
Answers: 3
question
Computers and Technology, 23.06.2019 23:30
A. in packet tracer, only the server-pt device can act as a server. desktop or laptop pcs cannot act as a server. based on your studies so far, explain the client-server model.
Answers: 2
question
Computers and Technology, 24.06.2019 03:30
Auniform resource locator (url) is a formatted string of text that web browsers, email applications, and other software programs use to identify a particular resource on the internet. true false
Answers: 2
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
You know the right answer?
Given an unsorted array of distinct integers numbers and is given a non-negative integer number, k,...
Questions
Questions on the website: 13722367