Java Software Structures: Designing and Using Data Structures
The second edition of Java Software Structures embraces the enhancements of Java 5.0, where all structures and collections are based on generics. The framework of the text walks the reader through three main areas: conceptualization, explanation, and implementation, allowing for a consistent and coherent introduction to data structures. The addition of integrated case studies provides complete examples to aid readers starting with the problem statement, to design rationale, through full implementation. Readers will learn how to develop high-quality software systems using well-designed collections and algorithms.
Results 1-3 of 8
Initially, all of the disks are stacked on one peg in order of size such that the
largest disk is on the bottom, as shown in Figure 10.6. The goal of the puzzle is to
move all of the disks from their original (first) peg to the destination (third) peg.
The initial call indicates that all of the disks should be moved from peg 1 to peg 3,
using peg 2 as the extra position. Listing 10.4 // TowersOf Hanoi . java Authors:
Lewis/Chase // // Represents the classic Towers of Hanoi puzzle.
If the body of the method is O(n), then the whole algorithm is O(n log n). Now
consider the Towers of Hanoi puzzle. The size of the puzzle is naturally the
number of disks, and the processing operation of interest is the step of moving
one disk ...
What people are saying - Write a review
17 other sections not shown