Invitation to Computer Science 8th Edition

Published by Cengage Learning
ISBN 10: 1337561916
ISBN 13: 978-1-33756-191-4

Chapter 3 - Exercises - Page 141: 8

Answer

The question suggests that the second algorithm for the Flipping Pancakes is not faster for any number of pancakes. To check whether this is true and to find the least number of pancakes required for the second algorithm to become more efficient we will do the following: $2 \cdot n-3=\frac{5 \cdot n+5}{3}$ We find that $n$ is $14 .$ This means that at 14 pancakes both algorithms have the same number of most flips needed. Once we have more than 14 pancakes, the second algorithm is more efficient.

Work Step by Step

--
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.