subject

Consider the following extension to binary search on a sorted array A for an item x: Let A[p] and A[q] be the partitioning elements of A so that A is divided into three roughly equal-sized lists (i. e., a difference of 1 or 2 is allowed between the sizes of these sub-lists but no more). Based on A[p] and A[q], decide the sub-list where x may exist. Repeat this process until the sub-list is small enough that the answer can be directly obtained. 1. Write pseudo-code for the above Ternary-Search method, specifying all the parameters correctly.
2. Derive the recurrence relation for the running time of the Ternary-Search algorithm.
3. Solve the recurrence relation, find a close-bound for the running time of the Ternary-Search and then express this close-bound using asymptotic notation.
4. Derive an expression and its asymptotic bound for the space complexity of the Ternary-Search.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 12:00, lyn94
Using the list, you can select the number of photos that will appear on each slide. a. theme b. frame shape c. pictures in album d. picture layout
Answers: 1
image
Computers and Technology, 23.06.2019 20:40, bobby3350
On nba 2k 19, every time i try to join a my park game, it leads ro a website telling my dad that he needs ps plus. i already have ps plus though. how do i fix this?
Answers: 2
image
Computers and Technology, 25.06.2019 07:00, ChHal1958
Afile named data. txt contains an unknown number of lines, each consisting of a single integer. write some code that creates two files, dataplus. txt and dataminus. txt, and copies all the lines of data1.txt that have positive integers to dataplus. txt, and all the lines of data1.txt that have negative integers to dataminus. txt. zeros are not copied anywhere.
Answers: 2
image
Computers and Technology, 25.06.2019 10:00, alexandroperez13
One way news orginaztions can influence people is by: a. slanting information b. accepting all beliefs c. sharing a true perspective d. giving people money
Answers: 1
You know the right answer?
Consider the following extension to binary search on a sorted array A for an item x: Let A[p] and A[...

Questions in other subjects:

Konu
English, 11.10.2019 19:50
Konu
Biology, 11.10.2019 19:50