0% found this document useful (0 votes)
20 views59 pages

Data Structures and Algorithm Analysis in Java 数据结构与算法分析 Java语言描述 数据结构与算法分析 Weiss download

The document is about 'Data Structures and Algorithm Analysis in Java' by Mark Allen Weiss, detailing various data structures, algorithm analysis, and their implementations in Java. It includes chapters on lists, stacks, queues, trees, hashing, priority queues, and sorting algorithms, along with exercises and references for deeper understanding. The book serves as a comprehensive resource for learning data structures and algorithms in the context of Java programming.

Uploaded by

pdbbuam230
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views59 pages

Data Structures and Algorithm Analysis in Java 数据结构与算法分析 Java语言描述 数据结构与算法分析 Weiss download

The document is about 'Data Structures and Algorithm Analysis in Java' by Mark Allen Weiss, detailing various data structures, algorithm analysis, and their implementations in Java. It includes chapters on lists, stacks, queues, trees, hashing, priority queues, and sorting algorithms, along with exercises and references for deeper understanding. The book serves as a comprehensive resource for learning data structures and algorithms in the context of Java programming.

Uploaded by

pdbbuam230
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

Data Structures and Algorithm Analysis in Java

■■■■■■■■■ Java■■■■ ■■■■■■■■■ Weiss - PDF Download


(2025)

https://ebookultra.com/download/data-structures-and-algorithm-
analysis-in-java-
%e6%95%b0%e6%8d%ae%e7%bb%93%e6%9e%84%e4%b8%8e%e7%ae%97%e6%b3%95%e
5%88%86%e6%9e%90-java%e8%af%ad%e8%a8%80%e6%8f%8f%e8%bf%b0-
%e6%95%b0%e6%8d%ae%e7%bb%93/

Visit ebookultra.com today to download the complete set of


ebooks or textbooks
We have selected some products that you may be interested in
Click the link to download now or visit ebookultra.com
for more options!.

The Anti Alapin Gambit Death to the 2 c3 Sicilian 1st


Edition Cyrus Lakdawala

https://ebookultra.com/download/the-anti-alapin-gambit-death-to-
the-2-c3-sicilian-1st-edition-cyrus-lakdawala/

Quick easy mexican cooking more than 80 everyday recipes


Lee

https://ebookultra.com/download/quick-easy-mexican-cooking-more-
than-80-everyday-recipes-lee/

Advances in Computers 80 1st Edition Marvin Zelkowitz


Ph.D. Ms Bs.

https://ebookultra.com/download/advances-in-computers-80-1st-edition-
marvin-zelkowitz-ph-d-ms-bs/

Pareto s 80 20 Rule for Corporate Accountants 1st Edition


David Parmenter

https://ebookultra.com/download/pareto-s-80-20-rule-for-corporate-
accountants-1st-edition-david-parmenter/
Pies Sweet and Savory Recipes from over 80 Great Chefs 1st
Edition Alan Batt

https://ebookultra.com/download/pies-sweet-and-savory-recipes-from-
over-80-great-chefs-1st-edition-alan-batt/

Frommer s Washington D C from 80 a Day 1st Edition Elise


Hartman Ford

https://ebookultra.com/download/frommer-s-washington-d-c-
from-80-a-day-1st-edition-elise-hartman-ford/

A Whisper of Cardamom 80 Sweetly Spiced Recipes to Fall in


Love With Eleanor Ford

https://ebookultra.com/download/a-whisper-of-cardamom-80-sweetly-
spiced-recipes-to-fall-in-love-with-eleanor-ford/

Authentic Recipes from China 80 Simple and Delicious


Recipes from the Middle Kingdom Kenneth Law

https://ebookultra.com/download/authentic-recipes-from-
china-80-simple-and-delicious-recipes-from-the-middle-kingdom-kenneth-
law/

EcoRedux Design Remedies for an Ailing Planet


Architectural Design November December 2010 Vol 80 No 6
1st Edition Kallipoliti Lydia
https://ebookultra.com/download/ecoredux-design-remedies-for-an-
ailing-planet-architectural-design-november-
december-2010-vol-80-no-6-1st-edition-kallipoliti-lydia/
Data Structures and Algorithm Analysis in Java
æ•°æ​®ç»“构与算法分æž​ Javaè¯​言æ​​è¿°
æ•°æ​®ç»“构与算法分æž​ Weiss Digital Instant
Download
Author(s): Weiss, Mark Allen
ISBN(s): 9787111412366, 7111412362
Edition: Reprinted ed.
File Details: PDF, 2.99 MB
Year: 2011
Language: english
This page intentionally left blank
International Edition contributions by
Arup Kumar Bhattacharjee
RCC Institute of Information Technology

Soumen Mukherjee
RCC Institute of Information Technology

Boston Columbus Indianapolis New York San Francisco Upper Saddle River
Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto
Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo
Editorial Director: Marcia Horton Publishing Assistant, International
Editor-in-Chief: Michael Hirsch Edition: Shokhi Shah
Editorial Assistant: Emma Snider Print and Media Editor, International
Director of Marketing: Patrice Jones Edition: Ashwitha Jayakumar
Marketing Manager: Yezan Alayan Project Editor, International Edition:
Marketing Coordinator: Kathryn Ferranti Jayashree Arunachalam
Director of Production: Vince O’Brien Art Director: Jayne Conte
Managing Editor: Jeff Holcomb Cover Designer: Bruce Kenselaar
Production Project Manager: Kayla Cover Photo: De-Kay
c Dreamstime.com
Smith-Tarbox Media Editor: Daniel Sandin
Project Manager: Pat Brown Full-Service Project Management: Integra
Manufacturing Buyer: Pat Brown Cover Printer: Lehigh-Phoenix
Publisher, International Edition: Angshuman Color/Hagerstown
Chakraborty
Acquisitions Editor, International Edition:
Somnath Basu

Pearson Education Limited


Edinburgh Gate
Harlow
Essex CM20 2JE
England
and Associated Companies throughout the world
Visit us on the World Wide Web at:
www.pearsoninternationaleditions.com

c Pearson Education Limited 2012
The right of Marl Allen Weiss to be identified as author of this work has been asserted by him in accordance with the
Copyright, Designs and Patents Act 1988.
Authorized adaptation from the United States edition, entitled Data Structures and Algorithm Analysis in Java, 3rd edition,
ISBN 9780-13-257627-7 by Mark Allen Weiss published by Pearson Education  c 2012.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any
form or by any means, electronic, mechanical, photocopying, recording or otherwise, without either the prior written
permission of the publisher or a licence permitting restricted copying in the United Kingdom issued by the Copyright
Licensing Agency Ltd, Saffron House, 6–10 Kirby Street, London EC1N 8TS.
All trademarks used herein are the property of their respective owners. The use of any trademark in this text does not
vest in the author or publisher any trademark ownership rights in such trademarks, nor does the use of such trademarks
imply any affiliation with or endorsement of this book by such owners.
Microsoft
R and Windows R are registered trademarks of the Microsoft Corporation in the U.S.A. and other countries.
Screen shots and icons reprinted with permission from the Microsoft Corporation. This book is not sponsored or
endorsed by or affiliated with the Microsoft Corporation.
British Library Cataloguing-in-Publication Data
A catalogue record for this book is available from the British Library
10 9 8 7 6 5 4 3 2 1
14 13 12 11 10
Typeset in Berkeley-Book by Integra
Printed and bound by Courier Berkeley-Book Westford in The United States of America
The publisher’s policy is to use paper manufactured from sustainable forests.

ISBN 10: 0-273-75211-1


ISBN 13: 978-0-273-75211-0
To the love of my life, Jill.
This page intentionally left blank
CONTENTS

Preface 17

Chapter 1 Introduction 21
1.1 What’s the Book About? 21
1.2 Mathematics Review 22
1.2.1 Exponents 23
1.2.2 Logarithms 23
1.2.3 Series 24
1.2.4 Modular Arithmetic 25
1.2.5 The P Word 26
1.3 A Brief Introduction to Recursion 28
1.4 Implementing Generic Components Pre-Java 5 32
1.4.1 Using Object for Genericity 33
1.4.2 Wrappers for Primitive Types 34
1.4.3 Using Interface Types for Genericity 34
1.4.4 Compatibility of Array Types 36
1.5 Implementing Generic Components Using Java 5 Generics 36
1.5.1 Simple Generic Classes and Interfaces 37
1.5.2 Autoboxing/Unboxing 38
1.5.3 The Diamond Operator 38
1.5.4 Wildcards with Bounds 39
1.5.5 Generic Static Methods 40
1.5.6 Type Bounds 41
1.5.7 Type Erasure 42
1.5.8 Restrictions on Generics 43

7
8 Contents

1.6 Function Objects 44


Summary 46
Exercises 46
References 48

Chapter 2 Algorithm Analysis 49


2.1 Mathematical Background 49
2.2 Model 52
2.3 What to Analyze 53
2.4 Running Time Calculations 55
2.4.1 A Simple Example 56
2.4.2 General Rules 56
2.4.3 Solutions for the Maximum Subsequence Sum Problem 59
2.4.4 Logarithms in the Running Time 65
2.4.5 A Grain of Salt 69
Summary 69
Exercises 70
References 75

Chapter 3 Lists, Stacks, and Queues 77


3.1 Abstract Data Types (ADTs) 77
3.2 The List ADT 78
3.2.1 Simple Array Implementation of Lists 78
3.2.2 Simple Linked Lists 79
3.3 Lists in the Java Collections API 81
3.3.1 Collection Interface 81
3.3.2 Iterator s 81
3.3.3 The List Interface, ArrayList, and LinkedList 83
3.3.4 Example: Using remove on a LinkedList 85
3.3.5 ListIterators 87
3.4 Implementation of ArrayList 87
3.4.1 The Basic Class 88
3.4.2 The Iterator and Java Nested and Inner Classes 91
3.5 Implementation of LinkedList 95
3.6 The Stack ADT 102
3.6.1 Stack Model 102
Contents 9

3.6.2 Implementation of Stacks 103


3.6.3 Applications 104
3.7 The Queue ADT 112
3.7.1 Queue Model 112
3.7.2 Array Implementation of Queues 112
3.7.3 Applications of Queues 115
Summary 116
Exercises 116

Chapter 4 Trees 121


4.1 Preliminaries 121
4.1.1 Implementation of Trees 122
4.1.2 Tree Traversals with an Application 123
4.2 Binary Trees 127
4.2.1 Implementation 128
4.2.2 An Example: Expression Trees 129
4.3 The Search Tree ADT—Binary Search Trees 132
4.3.1 contains 133
4.3.2 findMin and findMax 135
4.3.3 insert 136
4.3.4 remove 138
4.3.5 Average-Case Analysis 140
4.4 AVL Trees 143
4.4.1 Single Rotation 145
4.4.2 Double Rotation 148
4.5 Splay Trees 157
4.5.1 A Simple Idea (That Does Not Work) 157
4.5.2 Splaying 159
4.6 Tree Traversals (Revisited) 165
4.7 B-Trees 167
4.8 Sets and Maps in the Standard Library 172
4.8.1 Sets 172
4.8.2 Maps 173
4.8.3 Implementation of TreeSet and TreeMap 173
4.8.4 An Example That Uses Several Maps 174
Summary 180
Exercises 180
References 187
10 Contents

Chapter 5 Hashing 191


5.1 General Idea 191
5.2 Hash Function 192
5.3 Separate Chaining 194
5.4 Hash Tables Without Linked Lists 199
5.4.1 Linear Probing 199
5.4.2 Quadratic Probing 201
5.4.3 Double Hashing 203
5.5 Rehashing 208
5.6 Hash Tables in the Standard Library 209
5.7 Hash Tables with Worst-Case O(1) Access 212
5.7.1 Perfect Hashing 213
5.7.2 Cuckoo Hashing 215
5.7.3 Hopscotch Hashing 225
5.8 Universal Hashing 231
5.9 Extendible Hashing 234
Summary 237
Exercises 238
References 242

Chapter 6 Priority Queues (Heaps) 245


6.1 Model 245
6.2 Simple Implementations 246
6.3 Binary Heap 246
6.3.1 Structure Property 247
6.3.2 Heap-Order Property 249
6.3.3 Basic Heap Operations 249
6.3.4 Other Heap Operations 254
6.4 Applications of Priority Queues 258
6.4.1 The Selection Problem 258
6.4.2 Event Simulation 259
6.5 d-Heaps 260
6.6 Leftist Heaps 261
6.6.1 Leftist Heap Property 261
6.6.2 Leftist Heap Operations 262
6.7 Skew Heaps 269
Contents 11

6.8 Binomial Queues 272


6.8.1 Binomial Queue Structure 272
6.8.2 Binomial Queue Operations 273
6.8.3 Implementation of Binomial Queues 276
6.9 Priority Queues in the Standard Library 281
Summary 281
Exercises 283
References 287

Chapter 7 Sorting 291


7.1 Preliminaries 291
7.2 Insertion Sort 292
7.2.1 The Algorithm 292
7.2.2 Analysis of Insertion Sort 292
7.3 A Lower Bound for Simple Sorting Algorithms 293
7.4 Shellsort 294
7.4.1 Worst-Case Analysis of Shellsort 296
7.5 Heapsort 298
7.5.1 Analysis of Heapsort 299
7.6 Mergesort 302
7.6.1 Analysis of Mergesort 304
7.7 Quicksort 308
7.7.1 Picking the Pivot 310
7.7.2 Partitioning Strategy 312
7.7.3 Small Arrays 314
7.7.4 Actual Quicksort Routines 314
7.7.5 Analysis of Quicksort 317
7.7.6 A Linear-Expected-Time Algorithm for Selection 320
7.8 A General Lower Bound for Sorting 322
7.8.1 Decision Trees 322
7.9 Decision-Tree Lower Bounds for Selection Problems 324
7.10 Adversary Lower Bounds 327
7.11 Linear-Time Sorts: Bucket Sort and Radix Sort 330
7.12 External Sorting 335
7.12.1 Why We Need New Algorithms 336
7.12.2 Model for External Sorting 336
7.12.3 The Simple Algorithm 336
12 Contents

7.12.4 Multiway Merge 337


7.12.5 Polyphase Merge 338
7.12.6 Replacement Selection 339
Summary 341
Exercises 341
References 347

Chapter 8 The Disjoint Set Class 351


8.1 Equivalence Relations 351
8.2 The Dynamic Equivalence Problem 352
8.3 Basic Data Structure 353
8.4 Smart Union Algorithms 357
8.5 Path Compression 360
8.6 Worst Case for Union-by-Rank and Path Compression 361
8.6.1 Slowly Growing Functions 362
8.6.2 An Analysis By Recursive Decomposition 363
8.6.3 An O( M log * N ) Bound 370
8.6.4 An O( M α(M, N) ) Bound 370
8.7 An Application 372
Summary 375
Exercises 375
References 377

Chapter 9 Graph Algorithms 379


9.1 Definitions 379
9.1.1 Representation of Graphs 380
9.2 Topological Sort 382
9.3 Shortest-Path Algorithms 386
9.3.1 Unweighted Shortest Paths 387
9.3.2 Dijkstra’s Algorithm 392
9.3.3 Graphs with Negative Edge Costs 400
9.3.4 Acyclic Graphs 400
9.3.5 All-Pairs Shortest Path 404
9.3.6 Shortest-Path Example 404
9.4 Network Flow Problems 406
9.4.1 A Simple Maximum-Flow Algorithm 408
Contents 13

9.5 Minimum Spanning Tree 413


9.5.1 Prim’s Algorithm 414
9.5.2 Kruskal’s Algorithm 417
9.6 Applications of Depth-First Search 419
9.6.1 Undirected Graphs 420
9.6.2 Biconnectivity 422
9.6.3 Euler Circuits 425
9.6.4 Directed Graphs 429
9.6.5 Finding Strong Components 431
9.7 Introduction to NP-Completeness 432
9.7.1 Easy vs. Hard 433
9.7.2 The Class NP 434
9.7.3 NP-Complete Problems 435
Summary 437
Exercises 437
References 445

Chapter 10 Algorithm Design


Techniques 449
10.1 Greedy Algorithms 449
10.1.1 A Simple Scheduling Problem 450
10.1.2 Huffman Codes 453
10.1.3 Approximate Bin Packing 459
10.2 Divide and Conquer 468
10.2.1 Running Time of Divide-and-Conquer Algorithms 469
10.2.2 Closest-Points Problem 471
10.2.3 The Selection Problem 475
10.2.4 Theoretical Improvements for Arithmetic Problems 478
10.3 Dynamic Programming 482
10.3.1 Using a Table Instead of Recursion 483
10.3.2 Ordering Matrix Multiplications 486
10.3.3 Optimal Binary Search Tree 489
10.3.4 All-Pairs Shortest Path 492
10.4 Randomized Algorithms 494
10.4.1 Random Number Generators 496
10.4.2 Skip Lists 500
10.4.3 Primality Testing 503
14 Contents

10.5 Backtracking Algorithms 506


10.5.1 The Turnpike Reconstruction Problem 507
10.5.2 Games 510
Summary 519
Exercises 519
References 528

Chapter 11 Amortized Analysis 533


11.1 An Unrelated Puzzle 534
11.2 Binomial Queues 534
11.3 Skew Heaps 539
11.4 Fibonacci Heaps 542
11.4.1 Cutting Nodes in Leftist Heaps 542
11.4.2 Lazy Merging for Binomial Queues 545
11.4.3 The Fibonacci Heap Operations 548
11.4.4 Proof of the Time Bound 549
11.5 Splay Trees 551
Summary 556
Exercises 556
References 558

Chapter 12 Advanced Data Structures


and Implementation 561
12.1 Top-Down Splay Trees 561
12.2 Red-Black Trees 569
12.2.1 Bottom-Up Insertion 569
12.2.2 Top-Down Red-Black Trees 571
12.2.3 Top-Down Deletion 576
12.3 Treaps 578
12.4 Suffix Arrays and Suffix Trees 580
12.4.1 Suffix Arrays 581
12.4.2 Suffix Trees 584
12.4.3 Linear-Time Construction of Suffix Arrays and Suffix Trees 587
12.5 k-d Trees 598
Contents 15

12.6 Pairing Heaps 603


Summary 608
Exercises 610
References 614

Index 617
This page intentionally left blank
PREFACE

Purpose/Goals
This new Java edition describes data structures, methods of organizing large amounts of
data, and algorithm analysis, the estimation of the running time of algorithms. As computers
become faster and faster, the need for programs that can handle large amounts of input
becomes more acute. Paradoxically, this requires more careful attention to efficiency, since
inefficiencies in programs become most obvious when input sizes are large. By analyzing
an algorithm before it is actually coded, students can decide if a particular solution will be
feasible. For example, in this text students look at specific problems and see how careful
implementations can reduce the time constraint for large amounts of data from centuries
to less than a second. Therefore, no algorithm or data structure is presented without an
explanation of its running time. In some cases, minute details that affect the running time
of the implementation are explored.
Once a solution method is determined, a program must still be written. As computers
have become more powerful, the problems they must solve have become larger and more
complex, requiring development of more intricate programs. The goal of this text is to teach
students good programming and algorithm analysis skills simultaneously so that they can
develop such programs with the maximum amount of efficiency.
This book is suitable for either an advanced data structures (CS7) course or a first-year
graduate course in algorithm analysis. Students should have some knowledge of intermedi-
ate programming, including such topics as object-based programming and recursion, and
some background in discrete math.

Summary of the Most Significant Changes in the Third Edition


The third edition incorporates numerous bug fixes, and many parts of the book have
undergone revision to increase the clarity of presentation. In addition,
r Chapter 4 includes implementation of the AVL tree deletion algorithm—a topic often
requested by readers.
r Chapter 5 has been extensively revised and enlarged and now contains material on two
newer algorithms: cuckoo hashing and hopscotch hashing. Additionally, a new section
on universal hashing has been added.
r Chapter 7 now contains material on radix sort, and a new section on lower bound
proofs has been added. 17
18 Preface

r Chapter 8 uses the new union/find analysis by Seidel and Sharir, and shows the
O( Mα(M, N) ) bound instead of the weaker O( M log∗ N ) bound in prior editions.
r Chapter 12 adds material on suffix trees and suffix arrays, including the linear-time
suffix array construction algorithm by Karkkainen and Sanders (with implementation).
The sections covering deterministic skip lists and AA-trees have been removed.
r Throughout the text, the code has been updated to use the diamond operator from
Java 7.

Approach
Although the material in this text is largely language independent, programming requires
the use of a specific language. As the title implies, we have chosen Java for this book.
Java is often examined in comparison with C++. Java offers many benefits, and pro-
grammers often view Java as a safer, more portable, and easier-to-use language than C++.
As such, it makes a fine core language for discussing and implementing fundamental data
structures. Other important parts of Java, such as threads and its GUI, although important,
are not needed in this text and thus are not discussed.
Complete versions of the data structures, in both Java and C++, are available on
the Internet. We use similar coding conventions to make the parallels between the two
languages more evident.

Overview
Chapter 1 contains review material on discrete math and recursion. I believe the only way
to be comfortable with recursion is to see good uses over and over. Therefore, recursion
is prevalent in this text, with examples in every chapter except Chapter 5. Chapter 1 also
presents material that serves as a review of inheritance in Java. Included is a discussion of
Java generics.
Chapter 2 deals with algorithm analysis. This chapter explains asymptotic analysis and
its major weaknesses. Many examples are provided, including an in-depth explanation of
logarithmic running time. Simple recursive programs are analyzed by intuitively converting
them into iterative programs. More complicated divide-and-conquer programs are intro-
duced, but some of the analysis (solving recurrence relations) is implicitly delayed until
Chapter 7, where it is performed in detail.
Chapter 3 covers lists, stacks, and queues. This chapter has been significantly revised
from prior editions. It now includes a discussion of the Collections API ArrayList
and LinkedList classes, and it provides implementations of a significant subset of the
collections API ArrayList and LinkedList classes.
Chapter 4 covers trees, with an emphasis on search trees, including external search
trees (B-trees). The UNIX file system and expression trees are used as examples. AVL trees
and splay trees are introduced. More careful treatment of search tree implementation details
is found in Chapter 12. Additional coverage of trees, such as file compression and game
trees, is deferred until Chapter 10. Data structures for an external medium are considered
as the final topic in several chapters. New to this edition is a discussion of the Collections
API TreeSet and TreeMap classes, including a significant example that illustrates the use of
three separate maps to efficiently solve a problem.
Preface 19

Chapter 5 discusses hash tables, including the classic algorithms such as sepa-
rate chaining and linear and quadratic probing, as well as several newer algorithms,
namely cuckoo hashing and hopscotch hashing. Universal hashing is also discussed, and
extendible hashing is covered at the end of the chapter.
Chapter 6 is about priority queues. Binary heaps are covered, and there is additional
material on some of the theoretically interesting implementations of priority queues. The
Fibonacci heap is discussed in Chapter 11, and the pairing heap is discussed in Chapter 12.
Chapter 7 covers sorting. It is very specific with respect to coding details and analysis.
All the important general-purpose sorting algorithms are covered and compared. Four
algorithms are analyzed in detail: insertion sort, Shellsort, heapsort, and quicksort. New to
this edition is radix sort and lower bound proofs for selection-related problems. External
sorting is covered at the end of the chapter.
Chapter 8 discusses the disjoint set algorithm with proof of the running time. The anal-
ysis is new. This is a short and specific chapter that can be skipped if Kruskal’s algorithm
is not discussed.
Chapter 9 covers graph algorithms. Algorithms on graphs are interesting, not only
because they frequently occur in practice, but also because their running time is so heavily
dependent on the proper use of data structures. Virtually all the standard algorithms are
presented along with appropriate data structures, pseudocode, and analysis of running
time. To place these problems in a proper context, a short discussion on complexity theory
(including NP-completeness and undecidability) is provided.
Chapter 10 covers algorithm design by examining common problem-solving tech-
niques. This chapter is heavily fortified with examples. Pseudocode is used in these later
chapters so that the student’s appreciation of an example algorithm is not obscured by
implementation details.
Chapter 11 deals with amortized analysis. Three data structures from Chapters 4 and 6
and the Fibonacci heap, introduced in this chapter, are analyzed.
Chapter 12 covers search tree algorithms, the suffix tree and array, the k-d tree, and
the pairing heap. This chapter departs from the rest of the text by providing complete and
careful implementations for the search trees and pairing heap. The material is structured so
that the instructor can integrate sections into discussions from other chapters. For exam-
ple, the top-down red-black tree in Chapter 12 can be discussed along with AVL trees
(in Chapter 4).
Chapters 1–9 provide enough material for most one-semester data structures courses.
If time permits, then Chapter 10 can be covered. A graduate course on algorithm analysis
could cover Chapters 7–11. The advanced data structures analyzed in Chapter 11 can easily
be referred to in the earlier chapters. The discussion of NP-completeness in Chapter 9 is
far too brief to be used in such a course. You might find it useful to use an additional work
on NP-completeness to augment this text.

Exercises
Exercises, provided at the end of each chapter, match the order in which material is pre-
sented. The last exercises may address the chapter as a whole rather than a specific section.
Difficult exercises are marked with an asterisk, and more challenging exercises have two
asterisks.
Other documents randomly have
different content
The Project Gutenberg eBook of A Pacific
Coast Vacation
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

Title: A Pacific Coast Vacation

Author: Mrs. James Edwin Morris

Photographer: James Edwin Morris

Release date: September 10, 2020 [eBook #63172]


Most recently updated: October 18, 2024

Language: English

Credits: Produced by Charlene Taylor, Bryan Ness, Craig


Kirkwood,
and the Online Distributed Proofreading Team at
https://www.pgdp.net (This file was produced from
images
generously made available by The Internet
Archive/American
Libraries.)

*** START OF THE PROJECT GUTENBERG EBOOK A PACIFIC COAST


VACATION ***
MRS. JAMES EDWIN MORRIS.
A
PACIFIC COAST
VACATION

BY
Mrs. JAMES EDWIN MORRIS

Illustrated from Photographs Taken En Route


by James Edwin Morris

THE
Abbey Press
PUBLISHERS
114
FIFTH AVENUE
LONDON NEW YORK MONTREAL
Copyright, 1901,
by
THE
Abbey Press
Dedicated to Alaska’s Beautiful Daughter,
Miss Edna McFarland
Linked in my memory of those sea-girt shores where snow-crowned
mountains tower like castles old; where wild cataracts hurl their
waters down rugged cliffs to the sea; where sea gulls mingle their
cries with the rushing torrents; where frost giants stride up and
down the land; where the Aurora flames through the long winter
nights, will ever be the name of this gifted daughter of Alaska.
FOREWORD
If you ask what motive she who loved these scenes had in essaying
to portray them with pen and camera, she would reply that like the
Duke of Buckingham, when visiting the scene where Anna of Austria
had whispered that she loved him, let fall a precious gem that
another finding it, might be happy in that charméd spot where he
himself had been.
CONTENTS
PAGE
FOREWORD
CHAPTER
I. AUF WIEDERSEHEN 1
II. PLENTY OF ROOM 34
III. OFF FOR ALASKA 46
IV. FIRST VIEWS 59
V. FURTHER GLIMPSES 72
VI. GOLD FIELDS 85
VII. MUIR GLACIER 91
VIII. SITKA 103
IX. ALASKA 116
X. FAREWELL TO SKAGWAY 129
XI. WASHINGTON AND OREGON 137
XII. OFF FOR CALIFORNIA 160
XIII. SAN FRANCISCO 173
XIV. CALIFORNIA FARMS AND VINEYARDS 187
XV. YOSEMITE 191
XVI. SOUTHERN CALIFORNIA 210
XVII. HERE AND THERE ON THE COAST 217
XVIII. WALLA WALLA VALLEY 224
XIX. HISTORICAL REFERENCES 228
XX. YELLOWSTONE PARK 236
LIST OF ILLUSTRATIONS.
PAGE
Junction of the Mississippi and Black Rivers 9
Falls of Saint Anthony 11
Falls of Minnehaha 13
Old Fort Snelling 15
Roadway, Soldiers’ Barracks, Fort Snelling 17
Entering the Cascade Range 35
Lava Beds in Washington 37
Tangle of Wild Fern in a Washington Forest 39
Mount Rainier 41
Street in Tacoma, Washington 45
Parliament House, Victoria 51
Gorge of Homathco 53
Light House, Point Robert 55
Fjords of Alaska 57
Fishing Hamlet of Ketchikan 59
Fort Wrangel, Alaska 63
Chief Shake’s House, Fort Wrangel 67
Entering Wrangel Narrows 71
Douglas Island, Looking Toward Juneau 73
Silver Bow Cañon, Juneau. (By permission of F. Laroche,
photographer, Seattle, Washington) 75
Old Russian Court House, Juneau 77
Street in Juneau 79
Greek Church, Juneau 81
Indian Chief’s House, Juneau 83
Summit of the Selkirk Range, at Head of Yukon River. Old
Glory Waves Beside the British Flag 85
The Skagway Enchantress 89
Skagway, Showing White Pass 91
Muir Glacier (section of) 93
Greek Church, Killisnoo 99
Kitchnatti 101
Sitka—Soldiers’ Barracks, Old Russian Warehouse and Greek
Church on the right, Indian Village on the left, Russian
Blockhouses Beyond, and Mission Schools in the
Distance. (By permission of F. Laroche, photographer,
Seattle, Washington) 103
Indian Avenue, Sitka 105
Blockhouse on Bank of Indian River, Sitka, Alaska 107
Rapids, Indian River, Sitka 113
Where Whales and Porpoises Poke Their Noses Up Through
the Brine 119
Steamer Queen Leaving Juneau 133
Alps of America 135
Government Locks on the Columbia River 143
Rapids, Columbia River 145
Farm on the Bank of the Columbia River, Below the Dalles,
Oregon 147
Scene on an Oregon Farm in the Willamette Valley 151
Roadway in Oregon 153
Climbing the Shasta Range 163
The Highest Trestle in the World, near Muir’s Peak, Shasta
Range 165
Mount Shasta. (By permission of F. Laroche, photographer,
Seattle, Washington) 167
Street Scene in Chinatown, San Francisco 177
Museum in Golden Gate Park, San Francisco 181
Early Morning, Yosemite Valley 189
Wawona Valley 191
Oldest Log Cabin in the Sequoia Grove, Mariposa County,
California. Old Columbia in the Foreground 193
Half Dome and Merced River 195
Merced River, Yosemite Valley 197
Yosemite Falls 199
El Capitan 201
Bridal Veil Falls and the Three Brothers (solid rock) 203
Mirror Lake, Sleeping Water 205
Yosemite Falls, Showing Floor of the Valley 207
Sunrise in Yosemite Valley 209
Entering Hell Gate Cañon 233
Liberty Cap and Old Fort Yellowstone 235
Hotel Mammoth, Hot Springs, Yellowstone Park 237
Old Faithful Geyser, Yellowstone Park, Just Before an
Eruption 239
Yellowstone Lake 241
Camping on the Shore of Lake Yellowstone 243
Paint Pots on Shore of Yellowstone Lake 245
Grand Cañon of the Yellowstone 247
Gibbon River Falls 249
Micky and Annie Rooney 251
A Pacific Coast Vacation
CHAPTER I
AUF WIEDERSEHEN
Off to see the land of icebergs and glaciers; the land I have often
visited in my imagination. It seems but yesterday that the first
geography was put into my hands. O, that dear old geography, the
silent companion of my childhood days.
The first page to which I opened pictured an iceberg, with a polar
bear walking right up the perpendicular side, and another bold fellow
sitting on top as serenely as Patience on a monument.
“What was an iceberg? What were the bears doing on the ice and
what did they eat? Was that the sun shining over yonder? Why didn’t
it melt the ice and drop the bears into the sea? No, that was not the
sun, it was the aurora borealis. Aurora? Who was she and why did
she live in that cold, cold country, the home of Hoder, the gray old
god of winter?”
The phenomenon of the aurora was explained to us, but to our
childish imagination Aurora ever remained a maiden whose
wonderful hair of rainbow tints lit up the northern sky.
We talked of Aurora, we dreamed of Aurora, and now we are off to
see the charming ice maiden of our childhood fancy.
Off to Alaska. For years we have dreamed of it; for days and weeks
we have breakfasted on Rocky Mountain flora, lunched on icebergs
and glaciers and dined on totem poles and Indian chiefs.
Much of the charm of travel in any country comes of the glamour
with which fable and legend have enshrouded its historic places.
America is rapidly developing a legendary era. Travel up and down
the shores of the historic Hudson and note her fabled places.
The “Headless Hessian” still chases timid “Ichabods” through “Sleepy
Hollow.” “Rip Van Winkle,” the happy-go-lucky fellow, still stalks the
Catskills, gun in hand. The death light of “Jack Welsh” may be seen
on a summer’s night off the coast of Pond Cove. “Mother Crew’s” evil
spirit haunts Plymouth, while “Skipper Ireson” floats off Marble Head
in his ill-fated smack.
With a cloud for a blanket the “Indian Witch” of the Catskills sits on
her mountain peak sending forth fair weather and foul at her
pleasure, while the pygmies distil their magic liquor in the valley
below.
“Atlantis” lies fathoms deep in the blue waters of the Atlantic, and
the “Flying Dutchman” haunts the South Seas.
We have our Siegfried and our Thor, whom men call Washington and
Franklin. Our “Hymer” splits rocks and levels mountains with his
devil’s eye, though we call him dynamite.
Israel Putnam and Daniel Boone may yet live in history as the
Theseus and Perseus of our heroic age.
Certainly our country has her myths and her folk lore.
In time America, too, will have her saga book.
Yonder, Black Hawk, chief of the Sac, Fox, and Winnebago Indians,
made his last stand, was defeated by General Scott, captured and
carried to Washington and other cities of the East, where he
recognized the power of the nation to which he had come in contact.
Returning to his people, he advised them that resistance was
useless. The Indians then abandoned the disputed lands and retired
into Iowa.
Just north of Chicago we passed field after field yellow with the
bloom of mustard. Calling the porter I asked him what was being
grown yonder. He looked puzzled for a moment, then his face lighted
up with the inspiration of a happy thought as he replied:
“That, Madam, is dandelion.”
“O, thank you; I suppose that they are being grown for the Chicago
market?” said I, knowing that dandelion greens with the buds in
blossom and full bloom are considered a delicacy in the city.
“No, Madam,” answered my porter wise, “I don’t think them fields is
being cultivated at all.”
I forebore to point out to him the well kept fence and the marks of
the plow along it, but brought my field glasses into play and
discovered that the disputed fields had been sown to oats, but the
oats were being smothered out by the mustard.
Wisconsin is a beautiful state. Had the French government cultivated
the rich lands of the Mississippi valley and developed its mineral
resources as urged by Joliet, Wisconsin might still be a French
territory. But all his plans for colonization were rejected by the
government he served. A map of this country over which Joliet
traveled may be seen in the Archives de la Marine, Paris, France, to-
day.
The soil is light and farming in Wisconsin is along different lines from
that of her sister state, Illinois. In every direction great dairy barns
dot the landscape. Corn is grown almost entirely for fodder. The
seasons here are too short to mature it properly. In planting corn for
fodder it is sown much as are wheat and oats.
The principal crops of this great state are flax, oats, hops, and I
might add ice. Large ice houses are seen on every side. Much of the
country is yet wild. Acres of virgin prairie just now aglow with wild
flowers, take me back to my childhood, when we spent whole days
on the prairie, “Where the great warm heart of God beat down in the
sunshine and up from the sod;” where Marguerites and black-eyed
Susans nodded in the golden sunshine, and the thistle for very joy
tossed off her purple bonnet.
Here and there in northern Illinois and Wisconsin kettle holes mark
the track of the glaciers that once flowed down from the great névé
fields of Manitoba and the Hudson lake district.
In traveling across Wisconsin one is reminded of the time when
witches, devils, magicians, and manitous held sway over the Indian
mind.
Milwaukee is a name of Indian origin,—Mahn-a-wau-kie, anglicized
into Milwaukee—means in the language of the Winnebagoes, rich,
beautiful land.
According to an Indian legend the name comes from mahn-wau, a
root of wonderful medicinal properties. The healing power of this
root, found only in this locality, was so great that the Chippewas on
Lake Superior would give a beaver skin for a finger length piece.
The market place now stands on the site of a forest-clad hill, which
had been consecrated to the Great Manitou. Here tomahawks were
belted and knives were sheathed. Here the tribes of all the
surrounding country met to hold the peace dance which preceded
the religious festival. At the close of the religious services each
Indian carried away with him from the holy hill a memento to
worship as an amulet.
It was the greatest wish, the most passionate desire of every Indian
to be buried at the foot of this hill on the bank of the Mahn-a-wau-
kie.
Recent investigation has shown that Wisconsin was the dwelling
place of strange tribes long before the advent of the Indian.
The Dells of the Wisconsin river was a favorite resort of the Indian
manitous. Yonder is a chasm fifty feet wide, across which Black Hawk
leaped when fleeing from the whites. He surely had the aid of the
nether world.
In this beautiful region, hemmed in by rugged bowlder cliffs, lies a
veritable Sleepy Hollow. In a dense wood back of the cliff stands the
mythical “lost cabin.” Many have lost their way searching for it. The
strange thing about it is that they who have once found it are never
able to find it again. Weird stories are told about it. Its logs are old
and strange, different from the wood of the dark old forest in which
it stands. There are stories afloat that it is haunted by its former
inhabitants, who move it about from place to place.
At the foot of this rugged cliff lies Devil’s lake. At the head of this
fathomless body of water is a mound built in the form of an eagle
with wings outspread. Here, no doubt, lies buried a great chief.
Nothing is left in Wisconsin to-day of the Indian but footprints,—
mounds, graves, legends and myths.
At Devil’s Lake lived a manitou of wonderful power. This lake fills the
crater of an extinct volcano. Now this manitou, so the tale runs, piled
up those heavy blocks of stone, which form the Devil’s Doorway. He
also set up Black Monument and Pedestaled Bowlder for thrones
where he might sit and view the landscape o’er when on his visits to
the earth. These visits have ceased, since the white man possesses
the country. One day this wonderful manitou aimed a dart at a bad
Indian and missing him, cleft a huge rock in twain, which is now
known as Cleft Rock. At night, long ago, he might have been seen
sitting on one of his thrones or peeping out of the Devil’s Doorway
watching the dance of the frost fairies or gazing at the aurora
flaming through the night.
Every night at midnight Gitche Manitou appears in the middle of the
lake.
In days gone by a strange, wild creature, known as the Red Dwarf,
roamed the region of the great lakes, haunting alike the lives of red
man and white.
The snake god, the stone god, the witch of pictured rocks, were-
wolves and wizards held sway in that charméd region where San
Souci, Jean Beaugrand’s famous horse, despite his hundred years,
leaped wall of fort and stockade at pleasure.
JUNCTION OF THE MISSISSIPPI AND BLACK RIVERS.
At LaCrosse we crossed Black river into Minnesota and shortly after
crossed the Mississippi. LaCrosse, although French, originally, means
a game played by the Indian maidens on the ice. The heights on
either side of the Mississippi river remind one of the Catskills along
the Hudson. Indeed, the scenery is very similar. You easily imagine
yonder cliffs to be the palisades. Here, a spur of the Catskills range
and the little valley between might be Sleepy Hollow. But you miss
the historic places—Washington’s headquarters, Tarrytown, West
Point and others. Like forces produce like results. When you have
seen the Hudson river and its environs you have seen the upper
Mississippi.
St. Paul and Minneapolis form the commercial center of the North.
Although the ground freezes from fifteen to sixteen feet, the
concrete sidewalks and pavements show no effect of the touch of
Jack Frost’s icy fingers. The street-cars here are larger and heavier
than any I have ever seen. Then, too, they have large wheels, and
that sets them up so high. This is on account of the snow, which
lasts from Thanksgiving to Easter, good sleighing all the time.
The French and Indian have left to this region a nomenclature
peculiarly its own. There is Bear street and White Bear street. In the
shop windows are displayed headgear marked Black Bear, White Bear
and Red Cloud. There are on sale Indian dolls, Indian slippers,
French soldier dolls, Red Indian tobacco, showing the influence still
existing of the two peoples. One sees many French faces and hears
that language quite often on the streets and in the cars.
The falls of St. Anthony are at the foot of Fifth street in Minneapolis.
The water does not come leaping over, but pours over easily and
smoothly in one solid sheet. On either bank of the river are located
the largest flouring mills in the world. Not a drop of the old
Mississippi that comes sweeping over the falls but pays tribute in
furnishing power for these mills. Huge iron turbine wheels that
twenty men could not lift are turned as easily as a child rolls a hoop.
FALLS OF SAINT ANTHONY.
On the site of these mills long ago were camped the Dakotas. They
had just come down from another village where one of the men had
married another wife and brought her along. The woman was
stronger than the savage in wife number one, and when the Indians
broke camp and packed up their canoes and goods for the journey to
the foot of the falls, the forsaken wife, taking her child, leaped into a
canoe and rowed with a steady hand down stream toward the falls.
Her husband saw her and called to her, but she seemed not to hear
him and she did not even turn her head when his comrades joined
him in his cries. On swept the boat, while the broken-hearted wife
sang her death-song. Presently the falls were reached. The boat
trembled for a moment, then turning sideways, was dashed to pieces
on the rocks below.
Minnesota was the land of Gitche Manitou the Mighty and
Mudjekeewis. Mackinack was the home of Hiawatha and old
Nokomis. There Gitche Manitou made Adam and Eve and placed
them in the Indian Garden of Eden. One day Manitou or Great God
made a turtle and dropped it into Lake Huron. When it came up with
a mouth full of mud, Manitou took the mud and made the island of
Mackinack.
As we steamed up the Mississippi to the falls of Minnehaha we had a
good view of the bank swallows in their homes in the sandstone
banks along the river. The action of the air on sandstone hardens a
very thin crust on the surface, and when this is scraped off one can
easily dig into the bank. The swallows are geologists enough to know
this and hundreds of them have dug holes in the perpendicular walls.
Here the chattering, noisy little cave-dwellers fly in and out all day
long, flying up over the cliffs and away in search of food or resting in
the shrubbery which grows in the water near by. It is a pretty sight
to see the happy little fellows skim the water. It makes you wish that
you, too, had wings.
At the entrance of Minnehaha park we were greeted by a merry
wood thrush, whose voice is melodious beyond description. There he
sat on a swaggy limb not ten feet from us. We were familiar with his
biography and recognized him by his brown and white speckled coat.
We advanced cautiously. We had come six hundred miles to see him
and I think he knew it, too, for when we were so near that we could
have taken him in our hands he recognized our presence by nodding
his graceful head first this way, then that, and sang on. We spent
some ten minutes with him, then “bon voyage” he sang out as we
passed on.
FALLS OF MINNEHAHA.
Three miles above Minneapolis are the beautiful falls of Minnehaha,
Laughing Water. These falls are beautiful beyond the power of my
pen to describe. The water does not pour over, but comes leaping
and dancing, like one great shower of diamonds, pearls, sapphires
and rubies. The vast sheet of water sixty-five feet high reminds one
of a bridal veil decked with gems and sprinkled with diamond dust.

“Where the falls of Minnehaha


Flash and gleam among the oak trees,
Laugh and leap into the valley.”

It was here that Hiawatha came courting the lovely maiden


Minnehaha. The falls are surrounded by a government park. Hurrying
along through glen and dale, looking for the falls, we met a party of
young ladies who were having a picnic in the park.
I accosted one of them, “Beg pardon, Mademoiselle, can you tell me
where to find the falls?”
She looked astonished for a moment. “The falls of what?”
“The falls of Minnehaha.”
“O, I don’t know; never heard of her,” replied my maiden fair as she
turned and tripped away.
It has always seemed so strange to me that people living near places
of interest are oftentimes ignorant of the fact.
We next met a youth of some fourteen summers, who knew the
history of St. Paul, Minneapolis and their environs. He could tell you
all about the big mills, the soldiers, the barracks and old Fort
Snelling. He knew the story of Minnehaha, too; had been to the falls
hundreds of times, and knew the Song of Hiawatha as he knew his
alphabet. Gitche Manitou had but to set his foot on the earth and a
mighty river flowed from his tracks. Mudjekeewis was a great warrior,
but Hiawatha was his hero. It was with genuine regret that we bade
good-by to this interesting youth.

OLD FORT SNELLING.


Our next visit was to old Fort Snelling, three miles out from St. Paul.
This fort was built in 1820. It is round, two stories high and is
constructed of stone. The old fort, of course, is not used now. The
regular soldiers stationed here are located in delightful quarters. The
barracks are just beyond the old fort. The hospital is a large,
commodious building of stone. The parade field is a delightful bit of
rolling prairie. The barracks are quite deserted now, most of the
regiment being in the Philippines. Only a small detachment of
twenty-five troops remains to take care of the property. Fort Snelling
was the rendezvous of the Chippewas and the Sioux in the old days
of Indian occupation.
While the two tribes smoked the pipe of peace and made
protestations of friendship they might not intermarry.
At one of these meetings a Sioux brave won the heart of a Chippewa
maiden. Their love they kept a secret, but when the tribes met again
at old Fort Snelling a quarrel arose among the young warriors which
resulted in the death of a Sioux.
The Sioux fell upon the Chippewas with the cry of extermination.
In the midst of battle lover and loved one met, but for a moment.
They were swept apart and the young warrior knew that the fair
maiden lived only in the land of shadows.
There dwells in the river at the falls of Saint Anthony a dusky Undine.
She was once a mermaid living in a placid lake, longing for a soul
which the good Manitou finally promised her upon her marriage with
a mortal. The mortal appeared one day in the form of a handsome
Ottawa brave, and to him the beautiful mermaid told her tale of woe.
The two were wed. The mermaid received her soul and the form of a
human, but her new relatives disliked her. They quarreled over her
and at last the Ottawas and the Adirondacks fought over her, and
threw her into the river. There she lives to this day, thankfully giving
up her soul for the peace and quiet of a mermaid’s life.
This is the home of the pine and the birch. The white melilotus grows
rank in the byways of Minneapolis.
ROADWAY, SOLDIER’S BARRACKS, FORT SNELLING.
The horse may not have to go, but the bicycle has surely come to
stay. A unique figure on the streets of St. Paul is a window washer,
black as the ace of spades, mounted on a wheel. Rags of all sorts
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like