Skip to Main Content
Java 6 Illuminated: An Active Learning Approach, 2nd Edition
book

Java 6 Illuminated: An Active Learning Approach, 2nd Edition

by Julie Anderson, Herve J. Franceschi
February 2008
Intermediate to advanced content levelIntermediate to advanced
1288 pages
39h 39m
English
Jones & Bartlett Learning
Content preview from Java 6 Illuminated: An Active Learning Approach, 2nd Edition
972 CHAPTER 13 Recursion
The element at index 7 (36) is larger than 34, so we call the recursiveBinary-
Search method, searching the left subarray. However, that left subarray is
empty. We have not found 34, so we return 1.
13.6 Programming Activity 2: The Towers of Hanoi
A well-known problem that lends itself to an elegant recursive formulation
is the Towers of Hanoi. Here it is:
There are three towers, which we can represent as the source tower,
the temporary tower, and the destination tower.
We have a stack of n disks piled on the source tower; all the disks
have a different diameter. The largest disk is at the bottom and the
smallest disk is at ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JFC Swing Tutorial, The: A Guide to Constructing GUIs, Second Edition

JFC Swing Tutorial, The: A Guide to Constructing GUIs, Second Edition

Kathy Walrath, Mary Campione, Alison Huml, Sharon Zakhour
Java Illuminated, 4th Edition

Java Illuminated, 4th Edition

Julie Anderson, Hervé J. Franceschi

Publisher Resources

ISBN: 9780763749637