Data Structures & Algorithms in Python 1st Edition John Canninginstant download
Data Structures & Algorithms in Python 1st Edition John Canninginstant download
https://ebookmass.com/product/data-structures-algorithms-in-
python-1st-edition-john-canning-2/
https://ebookmass.com/product/data-structures-algorithms-in-
python-1st-edition-john-canning/
https://ebookmass.com/product/data-structures-and-algorithms-in-c-2nd-
edition/
https://ebookmass.com/product/a-textbook-of-data-structures-and-
algorithms-volume-2-mastering-nonlinear-data-structures-vijayalakshmi-
pai/
https://ebookmass.com/product/data-structure-and-algorithms-with-
python-the-ultimate-guide-towards-coding-john-thomas/
Absolute Beginner's Guide to Algorithms: A Practical
Introduction to Data Structures and Algorithms in
JavaScript Kirupa Chinnathambi
https://ebookmass.com/product/absolute-beginners-guide-to-algorithms-
a-practical-introduction-to-data-structures-and-algorithms-in-
javascript-kirupa-chinnathambi/
https://ebookmass.com/product/fundamentals-of-python-data-
structures-2nd-edition-kenneth-a-lambert/
https://ebookmass.com/product/a-textbook-of-data-structures-and-
algorithms-volume-1-g-a-vijayalakshmi-pai/
https://ebookmass.com/product/a-textbook-of-data-structures-and-
algorithms-volume-2-g-a-vijayalakshmi-pai/
John Canning
Alan Broder
Robert Lafore
Data
Structures &
Algorithms
in Python
1 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Arrays. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3 Simple Sorting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
4 Stacks and Queues. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5 Linked Lists. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
6 Recursion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
7 Advanced Sorting.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
8 Binary Trees. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
9 2-3-4 Trees and External Storage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
10 AVL and Red-Black Trees.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
11 Hash Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
12 Spatial Data Structures.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
13 Heaps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
14 Graphs.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
15 Weighted Graphs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
16 What to Use and Why.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813
Appendixes
A Running the Visualizations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833
B Further Reading. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
C Answers to Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859
1 Overview 1
What Are Data Structures and Algorithms?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Overview of Data Structures.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Overview of Algorithms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Some Definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Record. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Field. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Key. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Databases vs. Data Structures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Programming in Python. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Interpreter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Dynamic Typing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Sequences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Looping and Iteration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Multivalued Assignment.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Importing Modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Functions and Subroutines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
List Comprehensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Exceptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Object-Oriented Programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Questions.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Experiments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2 Arrays 29
The Array Visualization Tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Searching. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
The Duplicates Issue. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Using Python Lists to Implement the Array Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Creating an Array. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Accessing List Elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
A Better Array Class Implementation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
The OrderedArray Visualization Tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Linear Search. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Binary Search. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3 Simple Sorting 75
How Would You Do It?.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Bubble Sort. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Bubble Sort on the Football Players. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
The SimpleSorting Visualization Tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Python Code for a Bubble Sort.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Invariants. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Efficiency of the Bubble Sort.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Selection Sort. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Selection Sort on the Football Players. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
A Brief Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
A More Detailed Description.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
The Selection Sort in the SimpleSorting Visualization Tool. . . . . . . . . . . . . 85
Python Code for Selection Sort. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Invariant. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Efficiency of the Selection Sort.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Insertion Sort. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Insertion Sort on the Football Players. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Partial Sorting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
The Marked Player. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
The Insertion Sort in the SimpleSorting Visualization Tool. . . . . . . . . . . . . 89
Python Code for Insertion Sort. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
6 Recursion 229
Triangular Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Finding the nth Term Using a Loop. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Child.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
Sibling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Leaf. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Subtree. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Visiting.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Traversing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Levels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Keys. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Binary Trees. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Binary Search Trees. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
An Analogy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
How Do Binary Search Trees Work?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
The Binary Search Tree Visualization Tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
Representing the Tree in Python Code.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Finding a Node. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
Using the Visualization Tool to Find a Node. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
Python Code for Finding a Node.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Tree Efficiency. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Inserting a Node. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Using the Visualization Tool to Insert a Node.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Python Code for Inserting a Node. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
Traversing the Tree.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
In-order Traversal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
Pre-order and Post-order Traversals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Python Code for Traversing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
Traversing with the Visualization Tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Traversal Order. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
Finding Minimum and Maximum Key Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Deleting a Node.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Case 1: The Node to Be Deleted Has No Children. . . . . . . . . . . . . . . . . . . . . . . . . 367
Case 2: The Node to Be Deleted Has One Child. . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Case 3: The Node to Be Deleted Has Two Children. . . . . . . . . . . . . . . . . . . . . . . 370
The Efficiency of Binary Search Trees. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Trees Represented as Arrays.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
Tree Levels and Size. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
Printing Trees. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
Duplicate Keys.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
The BinarySearchTreeTester.py Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
The Huffman Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Character Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Decoding with the Huffman Tree. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
Creating the Huffman Tree. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
Questions.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
Experiments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
Programming Projects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
Questions.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
Experiments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
Programming Projects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
13 Heaps 665
Introduction to Heaps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
Priority Queues, Heaps, and ADTs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
Partially Ordered. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
Insertion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
Removal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
Other Operations.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
The Heap Visualization Tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
The Insert Button. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
The Make Random Heap Button. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
The Erase and Random Fill Button. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
The Peek Button. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
The Remove Max Button. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
The Heapify Button. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
14 Graphs 705
Introduction to Graphs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
Definitions.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
The First Uses of Graphs.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
Representing a Graph in a Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
Adding Vertices and Edges to a Graph. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
The Graph Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
Traversal and Search.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
Depth-First.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
Breadth-First. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
Minimum Spanning Trees.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
Minimum Spanning Trees in the Graph Visualization Tool. . . . . . . . . . . . 735
Trees Within a Graph. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
Python Code for the Minimum Spanning Tree. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
Topological Sorting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
Dependency Relationships.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
Directed Graphs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
Sorting Directed Graphs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
The Graph Visualization Tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743
The Topological Sorting Algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744
Cycles and Trees. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745
Python Code for the Basic Topological Sort. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
Appendixes
Index 859
Dave and Roger talked to the fruit-stand boy a few minutes longer,
and then jumped into the automobile and rode up to the Bliss
House, an old-fashioned hotel, standing on a corner and surrounded
by a number of stately elm trees.
“I can’t understand this at all, Dave,” said Roger, while on the way.
“What would take those girls uptown? They must have known that
the train might come along at any minute, and then, if they weren’t
on hand to get aboard, they’d be left.”
“It certainly is a mystery, Roger. All we can do is to follow up this
clue and see where it leads to. From what that man who had the
motorcycle said, and from what the lame boy told us, it is pretty
certain that Jessie and Laura got off the train at the Crossing and did
not get on again at this railroad station. And if they came up to the
hotel here, they must have had some purpose in so doing.”
The country hotel was not a very busy place, and the chums found
the clerk quite willing to give them all the information he could. He
did not, however, remember the girls; nor did the proprietor of the
place, who came up to see what was wanted, remember them.
“I don’t think they came here. Or, if they did, they didn’t come to the
office,” said the clerk. “I was here all day, and I know.”
“Did you have any strangers around the place that day, so far as you
can remember?” questioned Dave.
“None to stay. We had half a dozen drummers; but I know all of
them, for they have been coming and going for a number of years.”
“Wait a minute! Come to think of it, there was something else
happened that day which I thought was rather queer,” cried the
hotel proprietor suddenly. He was a bald-headed man, and he began
to scratch his hairless head vigorously. “Seems to me it was just
about half an hour or so before that train came in, too,” he added,
nodding his head emphatically.
“What was the thing that happened?” questioned Roger quickly.
“There was a big touring-car came down the Kapton road yonder. A
man dressed as a chauffeur was driving the machine. He stopped his
car and asked for directions, and then the car swung around and
came to a stop down there near our stables. I sent the boy out to
see if anything was wanted—the stable man being off on an errand
—and the boy came back and said they wanted to know when that
train would get in. Then the car moved over to the other side of the
street and stood there for five or ten minutes. The chauffeur turned
around in his seat to talk very earnestly to a couple who were in the
car. I couldn’t hear what they were saying, but they all seemed to be
rather excited. Then the car went back down the road, and that was
the last I saw of it.”
“It wasn’t a car that belonged around here, so far as you knew?”
asked our hero.
“No, it didn’t belong around here. It was a great big heavy enclosed
affair, and looked as if it had seen pretty rough usage—one of the
mud-guards being quite battered. That was one reason why I took
notice of it—I thought maybe they had been in some sort of an
accident, especially when the chauffeur and the people in the car
got to talking so excitedly among themselves.”
“Did you notice what kind of people they were?” asked Dave.
“I think the chauffeur was a foreigner. He had heavy dark hair and a
small dark mustache. He wore a regular cap and goggles, and also a
dust-coat.”
“Who were the people in the car?” questioned the senator’s son.
“There were a man and a woman, and I should say they were rather
elderly. The woman had a thick veil over her face, and the man wore
a dust-coat buttoned up around his throat and a cap pulled far down
over his forehead, and I think he had on smoked glasses. I thought
the whole bunch might be foreigners, and that was another reason
why I noticed them.”
“This is certainly interesting, but I don’t see how it connects up with
the disappearance of the girls,” was Dave’s comment.
“Those gypsies all look like foreigners,” said Roger.
“Yes. But I don’t think any of them knows how to run an auto. They
always use horses.”
“Oh, well, they might be getting up-to-date.”
Thinking that the incident of the strange touring-car might be worth
following up, Dave and Roger left the hotel and ran their own
automobile a distance along the Kapton road. From the hotel
proprietor they had learned that this road led to the small village of
Kapton two miles distant.
“This is a good deal like looking for a needle in a haystack,” was
Roger’s comment.
“True, Roger. But if you took the haystack and went over it a wisp at
a time, sooner or later you’d come on the needle,” answered Dave.
“And that is what I propose to do in this case—I’m going to follow
up every possible clue until we strike something.”
On the outskirts of Crandall they came upon a little country home
where several children were enjoying themselves at a swing in the
open dooryard. Here Dave stopped the car.
“I suppose you play here nearly every day,” he said to the oldest of
the girls, a bright miss of nine or ten years of age.
“Oh, yes; whenever the weather is good.”
“And we have lots of fun,” broke in another of the happy group.
“We are trying to find out something about a big automobile that
came along here about ten days ago,” said Roger. “It was a great big
enclosed car, and one of the mud-guards was smashed.”
“Oh, I remember that car, Nellie!” cried one of the girls. “Don’t you
remember? It’s the one that stopped over by Radley’s orchard.”
“Indeed I do remember!” answered Nellie, with a toss of her head.
“Didn’t they come close to running over Rover?”
“What did the car stop at the orchard for?” asked Dave.
“I don’t know exactly. I think they had to fix something on it.
Anyway, the man opened the tin door on the top of the front,”
answered the girl. “That was broken, too, just like the tin thing over
the wheels.”
“They didn’t stop for that,” said another one of the girls. “They
stopped to send Billy Barton on an errand down to the hotel.”
This announcement on the part of the little girl filled our hero and
Roger with increased interest.
“Where is this Billy Barton, and what did he go to the hotel for?”
questioned Dave.
“The man who ran the car gave Billy a note to give to two young
ladies who, he said, would either be at the hotel or would soon get
there. Billy said he saw two young ladies just going into the hotel,
and asked them if they were the people he was looking for, and they
said ‘Yes’; and so Billy gave them the note. The man gave him ten
cents for doing it. I wish I could deliver a note and get ten cents for
it,” continued the little girl wistfully.
“Well, you’re going to get ten cents for telling me all about those
people in the automobile,” said our hero, and produced several
dimes which he distributed among those present, much to their
astonishment and gratification.
“But that wasn’t all of it, mister,” said one of the girls. “Those young
ladies came up here and got into the automobile and rode away.”
“Got into the automobile and rode away!” burst out Dave and Roger
simultaneously.
“Yes, sir.”
“I saw them, too!” said the smallest of the girls, who had thus far
spoken but little. “They didn’t get in very easy though!”
“They didn’t get in easy?” queried our hero. “What do you mean?”
“Why the driver of the automobile and the man who was inside got
out and had to shove them both in. I thought they was fooling, but
they was awful rough about it.”
“Did the girls scream, or anything like that?” asked Roger.
“I don’t know. I wasn’t near enough to hear.”
“And then, when the girls were in the auto, what did the others do?”
“Oh, they drove away just as fast as they could. They drove so fast
that they nearly ran over old Mr. Merrick.”
“Who is he?”
“Why, don’t you know old Mr. Merrick?” asked the little girl. “He lives
’way up the road—up there where you see that little white house. He
was standing out in the middle of the road when the automobile
rushed past him so fast that he could hardly jump out of the way. He
was awful angry. He told my papa that he thought the man ought to
be arrested.”
“If only they had arrested them!” murmured Dave.
“And that was the last you saw of that automobile?” asked Roger.
“Yes, sir,” came from several of the girls at once.
“It hasn’t been this way again?”
“No, sir.”
After that the two chums questioned the little girls closer about the
general appearance of the car, and learned that the turnout not only
had one of the mud-guards badly bent, but that the side of the car
was scratched in several places and that the wind-shield was
cracked.
“That’s something to go by, but not much,” remarked our hero. “One
thing is certain, we are on the right trail at last. For some reason
that isn’t at all clear, Jessie and Laura left that train at the Crossing,
walked up to the railroad station here in town, and then to the hotel.
There they were met by the small boy with the note, and as a result
of receiving that note they came out here and either got into that
automobile willingly or were forced into it.”
“But where did the auto go to, Dave?”
“That remains to be found out.”
“Will you let the authorities know about this?”
“At once! The more people we get on this trail, the quicker we’ll be
able to run those rascals down.”
CHAPTER XXIV
ANOTHER CLUE
Dave and Roger lost no time in getting back to the business section
of Crandall, and there they inquired their way to police
headquarters. They found the chief in charge, and introducing
themselves asked him if he knew about the disappearance of the
girls.
“Oh, yes, I know all about that,” answered the chief. “We’ve been on
the watch for them, but so far nothing has come to light.”
Thereupon Dave and Roger related what they had heard from the
lame boy and those at the Bliss House, and then what the little girls
had told.
“This is mighty interesting,” mused the chief. “But I don’t see what I
can do except to have my men on the watch for that automobile. If
it turns up, do you want the party running it held?”
“I certainly do!” answered Dave. “Or better yet, if you get the
chance, have the auto followed and see where it goes to—especially
if it goes down the Kapton road.”
“All right, I’ll do that.”
From the police station the two young civil engineers hurried down
to the telegraph office, and there sent a long message to the folks in
Crumville. No message had arrived for them, so they took it for
granted that no news had come in at the Wadsworth place since
their departure.
“And now what’s the next move?” queried Roger, who in this affair
looked to Dave as the leader.
“I think we had better travel along that Kapton road and see if we
can find out anything more about that automobile and those in it,”
was the reply. “There is certainly no use in our continuing the trip
along the railroad.”
It was growing dark when Crandall was left behind, and they
journeyed forward on the Kapton road slowly, keeping their eyes
open for anything that might suggest a further solution of the
mystery they were endeavoring to unravel.
“We might stop and question that Mr. Merrick the little girls
mentioned,” suggested Roger.
“Yes, we can do that, although I doubt if the old man can add much
to what we already know.”
They found Mr. Aaron Merrick a very fussy old individual and hard to
talk to. He remembered the incident of the automobile very well,
and was highly indignant, but he could not tell anything about who
had been driving the car or who was inside.
“They went by me jest like a comet!” he explained. “I had to jump
fer my life, or I’d been run over sure! All them pesky rascals ought
to be put in prison. I don’t believe in autermobiles, anyway,” and he
looked rather indignantly at the two chums.
“Well, we are after the fellow who ran that auto,” answered Roger.
“And if we catch him he’ll go to prison fast enough.”
“What’s the matter? Did he steal that there car?”
“He did worse,” answered the senator’s son. “But we haven’t got
time to talk about that now,” he added, and hurried away, followed
by our hero. Mr. Merrick came after them, anxious to know what
might be wrong, but they did not enlighten him.
Half an hour later found the machine rolling into the little village of
Kapton. They had stopped twice on the way, but had learned
nothing more concerning the big touring car with the battered mud-
guard and the cracked wind-shield.
“Do you think we ought to stay here all night?” questioned Roger.
“That will depend on whether we can get accommodation or not,”
returned Dave. “Anyhow, we want to make some inquiries before we
leave this place.”
They soon learned that Kapton boasted of nothing in the way of a
hotel or boarding-house.
“But you can get pretty good accommodations at the Bliss House in
Crandall,” said the storekeeper, who gave them the information. “Or
else you can go to the American House at Frytown.”
“Is that in the opposite direction to Crandall?” questioned Dave.
“Yes, sir; it’s on the same road that you came up on. The road runs
right through Frytown to Cullomburg, and it’s a pretty fair road all
the way.”
“Then I guess we’ll go on to Frytown. By the way, can you give us
any information about a big touring-car that went through here
about ten days ago—a touring-car that had a battered mud-guard
and a cracked wind-shield and was driven by a fellow who looked
like a foreigner—a chap with a small black mustache?”
“Why, yes, I saw that car!” cried the storekeeper. “The fellow who
ran it came in here and bought a lot of groceries.”
“He did!” exclaimed both of the chums in surprise.
“Yes, sir.”
“When was this?”
“Let me see——” The storekeeper rubbed his chin reflectively. “I
guess it was just about a week ago to-day. The fellow came in and
said he was in a good deal of a hurry, so I and my clerk hustled to
get the order out for him. We packed it in a big box, and put the box
in the tonneau of the car. But what about this—is the man some
friend of yours?”
“Hardly a friend,” answered Dave quickly! “But we are very anxious
to locate him. Have you any idea where he came from or where he
went?”
“All I can say is that he came into this place from Frytown way, and
he turned around after he had the stuff and went back the way he
came.”
“Did he give you any names, or say where he was from?” questioned
Roger.
“No, he didn’t say anything excepting that he was buying the things
for some folks who were sick in a camp and couldn’t get away. I
asked him one or two questions, but he acted as if he didn’t want to
answer them, and so I didn’t say too much. You see, he paid spot
cash for what he got, so it was none of my business,” added the
storekeeper.
“Do you remember the things he got?” questioned Dave. And then,
as the storekeeper showed that he was becoming suspicious, our
hero added: “I may be perfectly frank with you, Mr. Linton. We
suspect that the man who is running that automobile is a fellow who
escaped some time ago from prison. In fact, we are not sure that he
owns the automobile he is running, and it is possible that he may be
mixed up in the abduction of two young ladies. That is why we are
so anxious to get on his trail.”
“You don’t say! Well, I’d want to get on the trail of a rascal like that
myself. Yes, I think I can tell you pretty near everything the fellow
bought.”
And thereupon the storekeeper enumerated a number of articles,
including coffee, sugar, flour, butter, and a quantity of canned goods.
“And was that all?” asked Roger, as the storekeeper paused.
“No. After he had those goods, he asked about a good strong
clothes-line, and then he bought a lock, some screws and nails, and
a hammer and a screwdriver.”
“And was that all?”
“That’s all, so far as I can remember. Oh, no! he did buy some
smoking tobacco and a couple of pipes and some packages of
cigarettes.”
“And how did the fellow look? Can you describe him?”
“I can’t say much except that he was rather tall and thin and had, as
you said, a little black mustache, and heavy black curly hair. His face
was very dark, as if he had gotten well tanned. He kept on his
automobile goggles, and had his cap pulled down well over his
forehead, and his dust-coat was buttoned up tight around his neck.”
“You haven’t seen him since?”
“I think I saw the automobile going by the door late one evening a
couple of nights ago, but I am not sure. You see, I am getting old,
and my eyesight ain’t none too good,” concluded the storekeeper.
When Dave and Roger returned to the automobile and headed the
car in the direction of Frytown, both were in a meditative mood.
“I think I can begin to figure this out, Roger,” said Dave slowly. “It
looks to me as if Jessie and Laura were being held prisoners
somewhere in this vicinity, and that that fellow who ran the car,
whoever he is, came down here to buy supplies for the crowd.”
“Yes. And do you remember what the storekeeper said about the
clothes-line and a lock and nails? More than likely they’ve got the
poor girls tied fast in some room, and they have put a new lock on
the door and nailed up the windows.”
“What you say would fit in very well with what the storekeeper told
us. If that rascal came here to get his supplies, it would seem to
indicate that the place where the girls are being kept prisoners must
be somewhere in this vicinity.”
“Yes, unless they did not dare to go to any town that was closer by.
For all we know, he may have come from twenty or thirty miles away
—or even farther than that.”
“Well, we’re on the right trail, anyway, and that’s something,”
returned Dave hopefully. Then he gave a sudden exclamation. “My
gracious! Why didn’t I think of that before?”
“Think of what, Dave?”
“Don’t you remember what the storekeeper said about that fellow
purchasing some cigarettes?”
“What of it?”
“Why, just this: One of the things that fastened the crime on Jasniff
and Merwell at the time Mr. Wadsworth’s jewelry factory was robbed
was the fact that both of those rascals were inveterate cigarette
smokers, and smoked a certain brand of Turkish cigarettes—a kind
that had a peculiar gold and blue band around the box. I’m going
back and ask that storekeeper what kind of cigarettes that fellow
got.”
And so speaking Dave made a sharp turn and brought the car
around, and in a moment more was on his way back to the store.
“Back again, eh?” said the proprietor. “You weren’t gone very long.”
“I believe, Mr. Linton, you said that fellow we were talking about
purchased some tobacco and cigarettes?”
“So I did.”
“Can you remember anything about the cigarettes? Please try to
think exactly of what happened when he asked for them.”
“Hum! Let me see!” The storekeeper meditated for a moment. “Oh,
yes, I remember now! He asked me if I had any Doradas or
Mimoras, or any other Turkish cigarettes. I told him No, we had very
little call for anything like that. So then he took half a dozen
packages of these,” and the storekeeper pointed to some cigarettes
in his showcase.
“Thank you. That’s all I wanted to know,” answered Dave. “Good
night”; and he hurried away to the automobile with Roger following.
“Well, what do you make of this?” questioned the senator’s son
quickly.
“I think we have found another clue, Roger. That fellow asked for
Doradas cigarettes. They are a Turkish brand, and come in a box
having a blue and gold band around it—the same kind of cigarettes
that Jasniff smoked when he and Merwell robbed Mr. Wadsworth’s
safe.”
CHAPTER XXV
WHAT HORSEHAIR HAD TO TELL
“Then you think the fellow purchased the cigarettes for Jasniff?”
questioned Roger, after our hero had made the declaration
concerning the Wadsworth robbery.
“Either that, Roger; or else the fellow purchased the cigarettes for
himself.”
“Do you mean to insinuate that that chauffeur was Nick Jasniff?”
exclaimed the senator’s son.
“Why not, Roger? It would be an easy matter for Jasniff to disguise
himself. In fact, if he was in any such game as this, I think that is
just what he would do. He could easily stain his skin with some
walnut juice, or something like that, gotten from the gypsies, and
then put on a wig and a false mustache.”
“I believe that’s just what he did!” exclaimed Roger. “I know one
thing—he was a good hand at running automobiles. I have seen him
do it.”
“The whole thing fits in pretty closely,” went on Dave. “First, Jasniff
was angry at Mr. Wadsworth and the rest of us for placing him in
prison. Next, he stole those letters and my money. The letters told
him all about the gypsies and their troubles with our folks. He put
two and two together, came on East, and fixed up the plan to kidnap
the girls.”
“But how did they get the girls to leave the train at Crandall and
then go from the hotel to where the automobile stood along the
road?”
“That is something still to be explained. But that can wait. What we
want to do just now is to find out where they took Jessie and Laura,
and rescue them.”
“It certainly is a great search, Dave. What are you going to do
next?”
“I think the best thing we can do is to work our way along to
Frytown. That is quite a place, and it is barely possible that from
there we can get into communication with Crumville on the long
distance telephone. If we can do that, we can tell the folks at home
all we have learned, and get them to send some first-class
detectives out this way to assist us in the search.”
“Let’s run rather slow on the way to Frytown,” suggested the
senator’s son. “We may be able to pick up more clues.”
“Yes, we’ll keep our eyes wide open.”
They presently found themselves on a lonely stretch of the country
road, and here it was so dark they had to turn on all the lights of the
machine.
“I’d give all I’m worth, Dave, if we could catch sight of that other
car,” remarked Roger, after a spell of silence.
“I’m afraid that’s too much to hope for,” answered our hero, with a
grim smile. “We ought to be thankful that we have learned as much
as we have. If we hadn’t met that fellow on the motorcycle down at
the Crossing, we might still be hunting for clues along the line of the
railroad between Crandall and Boston.”
“Oh, yes, I think we’ve done wonderfully well.”
On the way to Frytown they stopped at six or seven farmhouses, but
without learning anything that was to their advantage. Two farmers
had seen the big touring car with the battered mud-guard go by a
week or two before, but could give no definite information as to who
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
ebookmasss.com