Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, i need help on solving this assignment. i am,having trouble understanding the notations. its from my algorithms class. 1. Short questions: a) Provide the

Hi, i need help on solving this assignment. i am,having trouble understanding the notations. its from my algorithms class.

image text in transcribed

1. Short questions: a) Provide the definitions of O-notation and -notation. b) Express the function/(n) 2n3 + n2-10n + 3 in terms of -notation. 2. Rearrange the following functions in increasing order of their growth rate. 21,logn,n2, log2 n, n 3. a) Given an array A of n numbers, write down the binary search algorithm BinSearch(A, n, key) to determine whether there is a number in A that is equal to key. Assume that array A is sorted in non-decreasing order. b) Let T(n) be the runtime of the above binary search algorithm. Write down a recurrence relation for T(n). 4. Write down the merge-sort algorithm to sort n numbers in an array A in ascending order. a) First provide a description of the ideas used in the algorithm. b) Write the down pseudocode of the algorithm. c) Write a recurrence relation for the runtime, T(n), of this algorithm

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions