Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. a) [10pts] Give pseudocode of a recursive version InsertionSortRec of Insertion Sort, where the input list is an array b) [10pts] Repeat for linked

image text in transcribedimage text in transcribed

1. a) [10pts] Give pseudocode of a recursive version InsertionSortRec of Insertion Sort, where the input list is an array b) [10pts] Repeat for linked list. 2. Using the Ratio Limit Theorem, prove the following. O(10)O(lnn)O(n)O(nlnn)O(n2)O(n3)O(2n)O(4n). 3. [20pts] Suppose L[0:n1] is a sorted list of distinct integers (negative integers allowed). Design (describe at a high level, then give pseudocode) and analyze (best- and worst-case complexities) an algorithm similar to Binary Search that finds a fixed point, i.e., an index i such that L[i]=i or returns 1 if no such index exists. 4. a) [15pts] Prove by induction that (fib(n)fib(n+1))=(0111)n(01) b) [5pts] Briefly describe how the formula in part a) can be employed to design an algorithm for computing fib(n) using O(logn) multiplications. 5. A natural question to ask related to MergeSort is whether we can do better by dividing the list into more than two parts. It turns out we can't do any better. In this exercise you will verify this fact mathematically. TriMergeSort, given below, is a variant of MergeSort, where the list is split into three equal parts instead of two. For convenience, assume that n=3k, for some nonnegative integer k. a) [9pts] Give a recurrence relation for the worst-case complexity W(n) of TriMergeSort for an input list of size n. b) [9pts] Solve the recurrence formula you have given in (a) to obtain an explicit formula for the worst-case complexity W(n) of TriMergeSort. c) [2pts] Which is more efficient in the worst case, MergeSort or TriMergeSort? Discuss

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions

Question

Write down the Limitation of Beer - Lamberts law?

Answered: 1 week ago

Question

Discuss the Hawthorne experiments in detail

Answered: 1 week ago

Question

Explain the characteristics of a good system of control

Answered: 1 week ago

Question

State the importance of control

Answered: 1 week ago

Question

10. Describe the relationship between communication and power.

Answered: 1 week ago