1. Use mathematical induction to show that when n is a power of 2, T(n) = n lg n is the
solution of the recurrence relation
T(n) = (
2 if n = 2
2 · T(
n
2
) + n if n = 2k
for k > 1.
2. Suppose we are comparing implementations of Insert-sort and Merge-sort on
the same machine. For input of size n = 2k
for k ≥ 1, Insert-sort runs in 8n
2
comparisons, while Merge-sort runs in 64n lg n comparisons. For which value of n
does Insert-sort beat Merge-sort?
3. We can express Insert-sort as a recursive procedure as follows. In order to sort
A[1…n], we recursively sort A[1…n−1] and then insert A[n] into sorted array A[1…n−
1].
(a) Write the pseudocode for this recursive version of Insert-sort, name it Insertsort-recur.
(b) Write a recurrence for the running time of of Insert-sort-recur.
(c) Find the solution of the recurrence relation in (b).
(d) Is Insert-sort-recur more expensive than Insert-sort?
4. Given an array s = hs[1], s[2], . . . , s[n]i, and n = 2d
for some d ≥ 1. We want to find
the minimum and maximum values in s. We do this by comparing elements of s.
(a) The “obvious” algorithm makes 2n − 2 comparisons. Explain.
(b) Can we do it better? Specify a divide-and-conquer algorithm.
(c) Let T(n) = the number of comparisons your divide-and-conquer algorithm makes.
Write a recurrence relation for T(n).
(d) Show that your recurrence relation has as its solution T(n) = 3
2
n − 2.
5. Let S be an array of n integers such that S[1] < S[2] < · · · < S[n]. (1) Specify
an O(lg n) algorithm which either finds an i ∈ {1, 2, . . . n} such that S[i] = i or else
determine that there is no such i. (2) Justify the correctness and running time of your
algorithm.
You revealed that effectively!
online essay writer write my college essay write my book for me
Many thanks. I like this.
pay for college essays pay to get essay written
Awesome write ups. Many thanks!
write my admission essay custom essay writers write my philosophy paper for me
Regards! Loads of write ups!
casino online spielen roulette online casino live rsweeps online casino 777
With thanks! Plenty of information!
college essay writing service reviews writing a narrative essay law essay writing service australia
Thank you, Lots of stuff.
cheap assignment writing service essay writing service uk writing service essay
You actually reported that adequately.
coop will writing service essay writing service canada graduate school essay writing service
Factor clearly applied.!
professional paper writing services college essays writing custom essay writing service org reviews
Amazing lots of awesome information!
essay writing service reviews law school essay writing service best college admission essay writing service
Regards, Numerous knowledge!
best resume writing service uk the best essay writing service essay writing process
Seriously all kinds of fantastic data!
student essay writing best essay writing service free essay writer service
Useful posts. Many thanks.
24 hour essay writing service professional essay writing service are essay writing services any good
Amazing a lot of terrific material!
easy essay writing american essay writing service ebook writing service
Regards! Plenty of material.
best college application essay writing service are essay writing services legal steps to writing an argumentative essay
Many thanks. I enjoy it.
best australian essay writing service top executive resume writing service political science essay writing service
This is nicely said! !
english article writing service first writing service reviews best writing service discount code
Amazing facts. Kudos.
original essay writing service fiverr essay writing public service resume writing
Appreciate it! Loads of posts.
best assignment writing service australia best resume writing service atlanta persuasive essay writing service
Excellent write ups. Cheers.
writing services for college papers essay writing service quote coursework writing service review
Whoa plenty of wonderful information!
writing a compare and contrast essay law essay writing service college admissions essay writing service
You suggested this really well!
english writing correction service fake essay writing service free online will writing service uk
онлайн казино brillx сайт
brillx официальный сайт
Брилкс Казино – это небывалая возможность погрузиться в атмосферу роскоши и азарта. Каждая деталь сайта продумана до мельчайших нюансов, чтобы обеспечить вам комфортное и захватывающее игровое пространство. На страницах Brillx Казино вы найдете множество увлекательных игровых аппаратов, которые подарят вам эмоции, сравнимые только с реальной азартной столицей.Brillx Казино — это место, где сливаются воедино элегантность и бесконечные возможности. Необычная комбинация азартных игр и роскошной атмосферы позволит вам окунуться в мир бриллиантового веселья. Наше бриллиантовое казино уверенно входит в число лидеров азартной индустрии, и в этом году мы готовы порадовать вас еще большим разнообразием игр и выигрышей.
Hi, i think that i saw you visited my weblog so i came to “return the favor”.I am attempting to find
things to improve my web site!I suppose its ok to use some of your ideas!!