Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you explain these problems, please. Its for an algorithms class. 3. (20 pts) Consider the following pseudocode of an algorithm, assuming that the input

Can you explain these problems, please. Its for an algorithms class.

image text in transcribed

image text in transcribed

3. (20 pts) Consider the following pseudocode of an algorithm, assuming that the input is an Integer array A[1..n), where n is a power of 2. AWNA Some Algo(A) n--length[A] if n=1 then return A[1] for i = 2 ton do A[i] - A[i] - A[i 1] if A[n/2] > 0 return A[n/2] else return A[n] 600 V (a) (10 pts) Analyze running time of the above algorithm SomeAlgo and give the best bounds as you can on the running time of the algorithm. (b) (5 pts) Now assuming that lines 7 and 9 are replaced with 7 9 return SOMEALGO(A[1..n/2]) return SOMEALGO(A[in/2 + 1)..n)) Give the recurrence that represents the running time of the algorithm. (c) (5 pts) Determine the running time of the algorithm SOMEALGO by solving the recurrence you gave in (b)

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

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions