Another sense in which P is robust is that it allows one program to use another as a subroutine. If an algorithm B runs in polynomial time, and an algorithm A performs a polynomial number of steps, some of which call B as a subroutine, show that A also runs in polynomial time. Furthermore assume that B returns a Boolean, i.e., it also solves a decision problem. (Though not required, if you like, discuss how this could be false if B, although a polynomial-time algorithm, is allowed to return a string rather than a Boolean.)

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 7SA
icon
Related questions
Question
Another sense in which P is robust is that it allows one program to use another as a
subroutine. If an algorithm B runs in polynomial time, and an algorithm A performs
a polynomial number of steps, some of which call B as a subroutine, show that A also
runs in polynomial time.
Furthermore assume that B returns a Boolean, i.e., it also solves a decision problem. (Though
not required, if you like, discuss how this could be false if B, although a polynomial-time algorithm,
is allowed to return a string rather than a Boolean.)
Transcribed Image Text:Another sense in which P is robust is that it allows one program to use another as a subroutine. If an algorithm B runs in polynomial time, and an algorithm A performs a polynomial number of steps, some of which call B as a subroutine, show that A also runs in polynomial time. Furthermore assume that B returns a Boolean, i.e., it also solves a decision problem. (Though not required, if you like, discuss how this could be false if B, although a polynomial-time algorithm, is allowed to return a string rather than a Boolean.)
Exercise b. Polynomial subroutines. (Textbook problem 2.19)
Here is the exercise as stated in the textbook:
Transcribed Image Text:Exercise b. Polynomial subroutines. (Textbook problem 2.19) Here is the exercise as stated in the textbook:
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Recurrence Relation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning