Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is algorithm question Design algorithm to accept as input the following recurrence function forms Divide-and-Conquer: T(n) = aT(n/b) + f(n), where constants a is

this is algorithm question

Design algorithm to accept as input the following recurrence function forms

  • Divide-and-Conquer: T(n) = aT(n/b) + f(n), where constants a is an integer such that a 1 b > 1, and b is a rational number Note you are not being asked to accept T(n) = aT(n/b) + gT(n/h) + f(n) recurrence relations
  • Chip-and-Be-Conquered: T(n) = aT(n b) + f(n), where constants a is an integer such that a 1 b > 0, and b is an integer Your algorithm that must accept the following f (n) forms: polynomial - cnd where 0 < c < , and c is a rational number 0 < d < , and d is a rational number Example: (1/2)n(2/3)

  • In other words, how to print out the results of a recursion tree on the console (4 depths) as String format.
  • to pass into a method recursionTree an integer a, rational # b, rational # c, rational # d, and a Boolean value true for deciding between identifying whether the T(n) is a divide or chip by checking if a is an integer >=1 and b>1 it will be a divide, and chip will be used if a>1, and b is an integer.

steps

first started with for (int i=0; i<=3; i++) for each depth of recursion tree and then would decide whether T(n) is divide & conquer or chip by checking above conditions using if-else statement

Then, println the total cost/work done at each depth 0, 1, 2, 3 and also print each ith line 0, 1, 2, 3.

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

1st Edition

1597496251, 978-1597496254

More Books

Students also viewed these Databases questions

Question

8. How can you locate a business that you would like to purchase?

Answered: 1 week ago

Question

How much of this is in your direct control?

Answered: 1 week ago