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:30
One of your customers wants you to build a personal server that he can use in his home. one of his concerns is making sure he has at least one backup of their data stored on the server in the event that a disk fails. you have decided to back up his data using raid. since this server is for personal use only, the customer wants to keep costs down. therefore, he would like to keep the number of drives to a minimum. which of the following raid systems would best meet the customer's specifications? a. raid 0 b. raid 1 c. raid 5 d. raid 10
Answers: 3
question
Computers and Technology, 23.06.2019 06:30
Martha is designing a single-player game. her manager suggests that she plan the design to incorporate future modifications. which principle of game design relates to planning for future modifications?
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
In the blank libreoffice writer document, to start the process of entering a date field into a letter, click on the insert menu. edit menu. file menu. fields menu.
Answers: 3
question
Computers and Technology, 23.06.2019 15:30
Write a program in plp assembly that counts up by one starting from zero (or one) inside a loop and writes this value to the leds every time the value is increased. the memory address of the leds is 0xf0200000. the table below shows the meaning and an example usage of the instructions covered in the video, plp instructions for project 1. instruction example usage meaning load immediate li $t0, 8 register $t0 is set to the value, 8. store word sw $t2, 0($t1) the value in register $t1 is used as the memory address. the value in register $t2 is copied into this memory address. add addiu $t4, $t3, 29 register $t4 is assigned the sum of 29 and the value in register $t3. jump j your_label_name the program jumps to the line following the label, "your_label_name: ". label your label name: defines a label called "your_label_name: " that can be jumped to
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
Social Studies, 23.06.2019 05:00
question
French, 23.06.2019 05:00
question
Mathematics, 23.06.2019 05:00
Questions on the website: 13722367