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 22:20
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
question
Computers and Technology, 23.06.2019 00:50
Representa os dados de um banco de dados como uma coleç? o de tabelas constituídas por um conjunto de atributos, que definem as propriedades ou características relevantes da entidade que representam. marque a alternativa que representa o modelo descrito no enunciado. escolha uma:
Answers: 3
question
Computers and Technology, 23.06.2019 13:00
In excel - calculate the actual increase/decrease from first quarter to the second quarter then subtract subtract first quarter value from second quarter total then divide result by first quarter value
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
What is html ? give a small description about html
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, 24.09.2020 14:01
question
History, 24.09.2020 14:01
question
Spanish, 24.09.2020 14:01
question
Mathematics, 24.09.2020 14:01
Questions on the website: 13722359