## Java Software Structures: Designing and Using Data StructuresThe second edition of |

### From inside the book

Results 1-3 of 8

Page 324

Initially, all of the

largest

move all of the

Initially, all of the

**disks**are stacked on one peg in order of size such that thelargest

**disk**is on the bottom, as shown in Figure 10.6. The goal of the puzzle is tomove all of the

**disks**from their original (first) peg to the destination (third) peg.Page 326

The initial call indicates that all of the

using peg 2 as the extra position. Listing 10.4 // TowersOf Hanoi . java Authors:

Lewis/Chase // // Represents the classic Towers of Hanoi puzzle.

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.

Page 329

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

one

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 movingone

**disk**...### What people are saying - Write a review

We haven't found any reviews in the usual places.

### Contents

Software Development | 2 |

ObjectOriented Design | 30 |

Collections | 83 |

Copyright | |

17 other sections not shown

### Other editions - View all

Java Software Structures: Designing & Using Data Structures John Lewis,Joseph Chase No preview available - 2005 |

### Common terms and phrases

abstract add add add addElement ancestor tree array implementation ArrayList AVL tree B-tree binary search tree binary tree boolean button called Card Chapter complexity constructor contains count create data structure deckSet defined dequeue disks doubly linked list element stored empty enqueue example expression tree Figure hash table hashing function heap ImageIcon insertion insertion sort integer interface isEmpty iterator Java Collections API jss2 Key Concept left child Lewis/Chase linear linked implementation linked list loop merge sort method node null number of elements operation ordered list parameter parent path position postfix expression problem provides public class public void queue radix sort rear recursive reference variable remove represent return result Returns true right child root Self-Review Questions set collection sort algorithm stack static String subtree System.out.println target element temp tion toString traversal UML description undirected graph unordered list vertex vertices waterfall model web crawler