Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Some multiple choice questions on recursion 2. An algorithm design technique involving breaking a problem into smaller versions of the original is called a) top-down

Some multiple choice questions on recursion

2. An algorithm design technique involving breaking a problem into smaller versions of the original is called

a) top-down design

b) test-driven development

c) divide and conquer

d) search and destroy

3. Which of the following is a correct coding of the recursive expression for reversing a string?

a) reverse(s[1:]) + s[0]

b) s[0] + reverse(s[1:])

c) s[-1] + reverse(s[:-1])

d) both a and c

9. An infinite recursion will result in

a) a program that hangs.

b) a broken computer

c) a reboot

d) a run-time exception

10. The recursive Fibonacci function is inefficient because

a) recursion is inherently inefficient compared to iteration

b) calculating Fibonacci numbers is an intractable problem

c) it performs many repeated calculations

d) all of the above

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

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions