0% found this document useful (0 votes)
28 views

Data Structures and Algorithm Analysis in JavaTM 3rd edition by Mark Weiss 9780133465013 0133465012 - Get instant access to the full ebook with detailed content

The document provides links to download various editions of textbooks focused on data structures and algorithms, primarily authored by Mark Weiss and others. It includes titles such as 'Data Structures and Algorithm Analysis in Java' and 'Data Structures and Problem Solving Using Java.' The document also highlights the availability of additional resources and ebooks on the website ebookball.com.

Uploaded by

arrathimm
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Data Structures and Algorithm Analysis in JavaTM 3rd edition by Mark Weiss 9780133465013 0133465012 - Get instant access to the full ebook with detailed content

The document provides links to download various editions of textbooks focused on data structures and algorithms, primarily authored by Mark Weiss and others. It includes titles such as 'Data Structures and Algorithm Analysis in Java' and 'Data Structures and Problem Solving Using Java.' The document also highlights the availability of additional resources and ebooks on the website ebookball.com.

Uploaded by

arrathimm
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Download the full version and explore a variety of ebooks

or text books at https://ebookball.com

Data Structures and Algorithm Analysis in JavaTM


3rd edition by Mark Weiss 9780133465013 0133465012

_____ Follow the link below to get your download now _____

https://ebookball.com/product/data-structures-and-algorithm-
analysis-in-javatm-3rd-edition-by-mark-
weiss-9780133465013-0133465012-18710/

Access ebookball.com now to download high-quality


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

Data Structures And Algorithm Analysis in C 4th Edition by


Mark Weiss 013284737X 9780132847377

https://ebookball.com/product/data-structures-and-algorithm-analysis-
in-c-4th-edition-by-mark-weiss-013284737x-9780132847377-15292/

Outlines and Highlights for Data Structures and Algorithm


Analysis in C++ 3rd edition by Mark Allen Weiss ISBN
032144146X 9780321441461
https://ebookball.com/product/outlines-and-highlights-for-data-
structures-and-algorithm-analysis-in-c-3rd-edition-by-mark-allen-
weiss-isbn-032144146x-9780321441461-16464/

Data Structures and Algorithm Analysis in C++ 3rd edition


by Clifford Shaffer ISBN 048648582X 978-0486485829

https://ebookball.com/product/data-structures-and-algorithm-analysis-
in-c-3rd-edition-by-clifford-shaffer-
isbn-048648582x-978-0486485829-16486/

A Practical Introduction to Data Structures And Algorithm


Analysis 3rd Edition by Clifford Shaffer

https://ebookball.com/product/a-practical-introduction-to-data-
structures-and-algorithm-analysis-3rd-edition-by-clifford-
shaffer-15310/
Data Structures And Problem Solving Using Java 4th Edition
by Mark Weiss 0321541405 9780321541406

https://ebookball.com/product/data-structures-and-problem-solving-
using-java-4th-edition-by-mark-weiss-0321541405-9780321541406-17186/

Data Structures and Problem Solving Using Java 4th edition


by Mark Allen Weiss ISBN 0321541405 978-0321541406

https://ebookball.com/product/data-structures-and-problem-solving-
using-java-4th-edition-by-mark-allen-weiss-
isbn-0321541405-978-0321541406-16342/

JavaScript Data Structures and Algorithms An Introduction


to Understanding and Implementing Core Data Structure and
Algorithm Fundamentals 1st Editon by Sammie Bae ISBN
1484239873 9781484239872
https://ebookball.com/product/javascript-data-structures-and-
algorithms-an-introduction-to-understanding-and-implementing-core-
data-structure-and-algorithm-fundamentals-1st-editon-by-sammie-bae-
isbn-1484239873-9781484239872-15798/

C Plus Data Structures 3rd Edition by Nell Dale ISBN


0763704810 9780763704810

https://ebookball.com/product/c-plus-data-structures-3rd-edition-by-
nell-dale-isbn-0763704810-9780763704810-12430/

Mechanical engineering Analysis Uncertainties and Control


3rd Edition by Haym Benaroya, Mark Nagurka 1420080563
978-8182091047
https://ebookball.com/product/mechanical-engineering-analysis-
uncertainties-and-control-3rd-edition-by-haym-benaroya-mark-
nagurka-1420080563-978-8182091047-17826/
This page intentionally left blank
Third Edition

Data
Structures
and Algorithm
Analysis in

JavaTM
TM
This page intentionally left blank
Third Edition

Data
Structures
and Algorithm
Analysis in

Java
TM

Mark A l l e n Weiss
Florida International University

PEARSON

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 Project Manager: Pat Brown
Editor-in-Chief: Michael Hirsch Manufacturing Buyer: Pat Brown
Editorial Assistant: Emma Snider Art Director: Jayne Conte
Director of Marketing: Patrice Jones Cover Designer: Bruce Kenselaar
Marketing Manager: Yezan Alayan Cover Photo:  c De-Kay Dreamstime.com
Marketing Coordinator: Kathryn Ferranti Media Editor: Daniel Sandin
Director of Production: Vince O’Brien Full-Service Project Management: Integra
Managing Editor: Jeff Holcomb Composition: Integra
Production Project Manager: Kayla Printer/Binder: Courier Westford
Smith-Tarbox Cover Printer: Lehigh-Phoenix Color/Hagerstown
Text Font: Berkeley-Book

Copyright  c 2012, 2007, 1999 Pearson Education, Inc., publishing as Addison-Wesley. All rights reserved.
Printed in the United States of America. This publication is protected by Copyright, and permission should
be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or trans-
mission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. To obtain
permission(s) to use material from this work, please submit a written request to Pearson Education, Inc.,
Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458, or you may fax your
request to 201-236-3290.

Many of the designations by manufacturers and sellers to distinguish their products are claimed as trade-
marks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the
designations have been printed in initial caps or all caps.

Library of Congress Cataloging-in-Publication Data


Weiss, Mark Allen.
Data structures and algorithm analysis in Java / Mark Allen Weiss. – 3rd ed.
p. cm.
ISBN-13: 978-0-13-257627-7 (alk. paper)
ISBN-10: 0-13-257627-9 (alk. paper)
1. Java (Computer program language) 2. Data structures (Computer science)
3. Computer algorithms. I. Title.
QA76.73.J38W448 2012
005.1–dc23 2011035536

15 14 13 12 11—CRW—10 9 8 7 6 5 4 3 2 1

ISBN 10: 0-13-257627-9


ISBN 13: 9780-13-257627-7
To the love of my life, Jill.
This page intentionally left blank
CONTENTS

Preface xvii

Chapter 1 Introduction 1
1.1 What’s the Book About? 1
1.2 Mathematics Review 2
1.2.1 Exponents 3
1.2.2 Logarithms 3
1.2.3 Series 4
1.2.4 Modular Arithmetic 5
1.2.5 The P Word 6
1.3 A Brief Introduction to Recursion 8
1.4 Implementing Generic Components Pre-Java 5 12
1.4.1 Using Object for Genericity 13
1.4.2 Wrappers for Primitive Types 14
1.4.3 Using Interface Types for Genericity 14
1.4.4 Compatibility of Array Types 16
1.5 Implementing Generic Components Using Java 5 Generics 16
1.5.1 Simple Generic Classes and Interfaces 17
1.5.2 Autoboxing/Unboxing 18
1.5.3 The Diamond Operator 18
1.5.4 Wildcards with Bounds 19
1.5.5 Generic Static Methods 20
1.5.6 Type Bounds 21
1.5.7 Type Erasure 22
1.5.8 Restrictions on Generics 23

vii
viii Contents

1.6 Function Objects 24


Summary 26
Exercises 26
References 28

Chapter 2 Algorithm Analysis 29


2.1 Mathematical Background 29
2.2 Model 32
2.3 What to Analyze 33
2.4 Running Time Calculations 35
2.4.1 A Simple Example 36
2.4.2 General Rules 36
2.4.3 Solutions for the Maximum Subsequence Sum Problem 39
2.4.4 Logarithms in the Running Time 45
2.4.5 A Grain of Salt 49
Summary 49
Exercises 50
References 55

Chapter 3 Lists, Stacks, and Queues 57


3.1 Abstract Data Types (ADTs) 57
3.2 The List ADT 58
3.2.1 Simple Array Implementation of Lists 58
3.2.2 Simple Linked Lists 59
3.3 Lists in the Java Collections API 61
3.3.1 Collection Interface 61
3.3.2 Iterator s 61
3.3.3 The List Interface, ArrayList, and LinkedList 63
3.3.4 Example: Using remove on a LinkedList 65
3.3.5 ListIterators 67
3.4 Implementation of ArrayList 67
3.4.1 The Basic Class 68
3.4.2 The Iterator and Java Nested and Inner Classes 71
3.5 Implementation of LinkedList 75
3.6 The Stack ADT 82
3.6.1 Stack Model 82
Contents ix

3.6.2 Implementation of Stacks 83


3.6.3 Applications 84
3.7 The Queue ADT 92
3.7.1 Queue Model 92
3.7.2 Array Implementation of Queues 92
3.7.3 Applications of Queues 95
Summary 96
Exercises 96

Chapter 4 Trees 101


4.1 Preliminaries 101
4.1.1 Implementation of Trees 102
4.1.2 Tree Traversals with an Application 103
4.2 Binary Trees 107
4.2.1 Implementation 108
4.2.2 An Example: Expression Trees 109
4.3 The Search Tree ADT—Binary Search Trees 112
4.3.1 contains 113
4.3.2 findMin and findMax 115
4.3.3 insert 116
4.3.4 remove 118
4.3.5 Average-Case Analysis 120
4.4 AVL Trees 123
4.4.1 Single Rotation 125
4.4.2 Double Rotation 128
4.5 Splay Trees 137
4.5.1 A Simple Idea (That Does Not Work) 137
4.5.2 Splaying 139
4.6 Tree Traversals (Revisited) 145
4.7 B-Trees 147
4.8 Sets and Maps in the Standard Library 152
4.8.1 Sets 152
4.8.2 Maps 153
4.8.3 Implementation of TreeSet and TreeMap 153
4.8.4 An Example That Uses Several Maps 154
Summary 160
Exercises 160
References 167
x Contents

Chapter 5 Hashing 171


5.1 General Idea 171
5.2 Hash Function 172
5.3 Separate Chaining 174
5.4 Hash Tables Without Linked Lists 179
5.4.1 Linear Probing 179
5.4.2 Quadratic Probing 181
5.4.3 Double Hashing 183
5.5 Rehashing 188
5.6 Hash Tables in the Standard Library 189
5.7 Hash Tables with Worst-Case O(1) Access 192
5.7.1 Perfect Hashing 193
5.7.2 Cuckoo Hashing 195
5.7.3 Hopscotch Hashing 205
5.8 Universal Hashing 211
5.9 Extendible Hashing 214
Summary 217
Exercises 218
References 222

Chapter 6 Priority Queues (Heaps) 225


6.1 Model 225
6.2 Simple Implementations 226
6.3 Binary Heap 226
6.3.1 Structure Property 227
6.3.2 Heap-Order Property 229
6.3.3 Basic Heap Operations 229
6.3.4 Other Heap Operations 234
6.4 Applications of Priority Queues 238
6.4.1 The Selection Problem 238
6.4.2 Event Simulation 239
6.5 d-Heaps 240
6.6 Leftist Heaps 241
6.6.1 Leftist Heap Property 241
6.6.2 Leftist Heap Operations 242
6.7 Skew Heaps 249
Contents xi

6.8 Binomial Queues 252


6.8.1 Binomial Queue Structure 252
6.8.2 Binomial Queue Operations 253
6.8.3 Implementation of Binomial Queues 256
6.9 Priority Queues in the Standard Library 261
Summary 261
Exercises 263
References 267

Chapter 7 Sorting 271


7.1 Preliminaries 271
7.2 Insertion Sort 272
7.2.1 The Algorithm 272
7.2.2 Analysis of Insertion Sort 272
7.3 A Lower Bound for Simple Sorting Algorithms 273
7.4 Shellsort 274
7.4.1 Worst-Case Analysis of Shellsort 276
7.5 Heapsort 278
7.5.1 Analysis of Heapsort 279
7.6 Mergesort 282
7.6.1 Analysis of Mergesort 284
7.7 Quicksort 288
7.7.1 Picking the Pivot 290
7.7.2 Partitioning Strategy 292
7.7.3 Small Arrays 294
7.7.4 Actual Quicksort Routines 294
7.7.5 Analysis of Quicksort 297
7.7.6 A Linear-Expected-Time Algorithm for Selection 300
7.8 A General Lower Bound for Sorting 302
7.8.1 Decision Trees 302
7.9 Decision-Tree Lower Bounds for Selection Problems 304
7.10 Adversary Lower Bounds 307
7.11 Linear-Time Sorts: Bucket Sort and Radix Sort 310
7.12 External Sorting 315
7.12.1 Why We Need New Algorithms 316
7.12.2 Model for External Sorting 316
7.12.3 The Simple Algorithm 316
xii Contents

7.12.4 Multiway Merge 317


7.12.5 Polyphase Merge 318
7.12.6 Replacement Selection 319
Summary 321
Exercises 321
References 327

Chapter 8 The Disjoint Set Class 331


8.1 Equivalence Relations 331
8.2 The Dynamic Equivalence Problem 332
8.3 Basic Data Structure 333
8.4 Smart Union Algorithms 337
8.5 Path Compression 340
8.6 Worst Case for Union-by-Rank and Path Compression 341
8.6.1 Slowly Growing Functions 342
8.6.2 An Analysis By Recursive Decomposition 343
8.6.3 An O( M log * N ) Bound 350
8.6.4 An O( M α(M, N) ) Bound 350
8.7 An Application 352
Summary 355
Exercises 355
References 357

Chapter 9 Graph Algorithms 359


9.1 Definitions 359
9.1.1 Representation of Graphs 360
9.2 Topological Sort 362
9.3 Shortest-Path Algorithms 366
9.3.1 Unweighted Shortest Paths 367
9.3.2 Dijkstra’s Algorithm 372
9.3.3 Graphs with Negative Edge Costs 380
9.3.4 Acyclic Graphs 380
9.3.5 All-Pairs Shortest Path 384
9.3.6 Shortest-Path Example 384
9.4 Network Flow Problems 386
9.4.1 A Simple Maximum-Flow Algorithm 388
Contents xiii

9.5 Minimum Spanning Tree 393


9.5.1 Prim’s Algorithm 394
9.5.2 Kruskal’s Algorithm 397
9.6 Applications of Depth-First Search 399
9.6.1 Undirected Graphs 400
9.6.2 Biconnectivity 402
9.6.3 Euler Circuits 405
9.6.4 Directed Graphs 409
9.6.5 Finding Strong Components 411
9.7 Introduction to NP-Completeness 412
9.7.1 Easy vs. Hard 413
9.7.2 The Class NP 414
9.7.3 NP-Complete Problems 415
Summary 417
Exercises 417
References 425

Chapter 10 Algorithm Design


Techniques 429
10.1 Greedy Algorithms 429
10.1.1 A Simple Scheduling Problem 430
10.1.2 Huffman Codes 433
10.1.3 Approximate Bin Packing 439
10.2 Divide and Conquer 448
10.2.1 Running Time of Divide-and-Conquer Algorithms 449
10.2.2 Closest-Points Problem 451
10.2.3 The Selection Problem 455
10.2.4 Theoretical Improvements for Arithmetic Problems 458
10.3 Dynamic Programming 462
10.3.1 Using a Table Instead of Recursion 463
10.3.2 Ordering Matrix Multiplications 466
10.3.3 Optimal Binary Search Tree 469
10.3.4 All-Pairs Shortest Path 472
10.4 Randomized Algorithms 474
10.4.1 Random Number Generators 476
10.4.2 Skip Lists 480
10.4.3 Primality Testing 483
Other documents randomly have
different content
The Project Gutenberg eBook of A China cup,

and other stories for children


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 China cup, and other stories for children

Author: F. Volkhovskii

Illustrator: Mikhail Egorovich Malyshev

Release date: February 21, 2021 [eBook #64606]


Most recently updated: October 18, 2024

Language: English

Credits: Carlos Colón, Harvard University and the Online


Distributed Proofreading Team at
https://www.pgdp.net (This book was produced from
images made available by the HathiTrust Digital
Library.)

*** START OF THE PROJECT GUTENBERG EBOOK A CHINA CUP,


AND OTHER STORIES FOR CHILDREN ***
Transcriber's Notes:

Blank pages have been eliminated.

Variations in spelling and hyphenation have been left as


in the original.

A few typographical errors have been corrected.

The cover page was created by the transcriber and can


be considered public domain.
THE CHILDREN'S LIBRARY

A CHINA CUP AND OTHER

STORIES FOR CHILDREN


THE CHILDREN'S LIBRARY.

THE BROWN OWL.


A CHINA CUP, and other Stories.
STORIES FROM FAIRYLAND.
THE STORY OF A PUPPET.
THE LITTLE PRINCESS.
TALES FROM THE MABINOGION.
"Seizing a heavy silver candlestick, the Magnate flung it violently at
the fowl."
Page 46.
A CHINA CUP
AND
OTHER STORIES FOR CHILDREN

BY

FELIX VOLKHOVSKY

ILLUSTRATED BY MALISCHEFF

LONDON
T. FISHER UNWIN
1892
SECOND EDITION
CONTENTS

PAGE
I. A China Cup 3
II. How Scarlet-Comb the Cock defended the Right 37
III. The Tiny Screw 65
IV. The Dream 85
V. Browny 115
VI. The Old Sword's Mistake 125
VII. 'My Own' 141
VIII. The Tale about how all these Tales came to Light 167
A CHINA CUP
waggon drove to the great pit dug in the clay—not
common clay, but such as china vessels are made of. A
man with an iron spade jumped from the waggon; he
entered the pit and began to dig the clay. After the first
stroke of the spade a little lump fell out of the native
ground, and with a bitter, plaintive murmur rolled down. Nobody
heard the murmur; it seemed to the workman that the Lump in
rolling down made a slight noise, whereas it was groaning: it was
hard to be torn away from mother earth. 'All is over,' it whispered;
'oh, how hard it is to live in the world!'
The workman took it up on his spade with the other clay, and threw
it into the waggon. 'Oh!' groaned the bit of clay from pain, as it fell
on the bottom of the waggon; 'not only was I torn away from my
mother, but thrown far away from her. Alas! is there any one more
unhappy in this world than I? I should like to die!'
But the Lump did not die. The workman had soon filled up his
waggon, jumped in himself, and drove away, carrying it to the china
factory. It was pretty well while they were going along an even
place, but when they went down a steep mountain-side, the horse
ran fast, and our Lump was jolted, thrown from side to side, and
knocked against the waggon. Nor did all its torments end then. As
soon as it was brought to the china factory, it was thrown with other
clay into a large tub with water in it, and it felt with horror how it
began gradually to get soft, and to be transformed into a sort of soft
mud. It had no time to recover, as it was taken out with a great ladle
and poured somewhere—it was into the funnel of the great
millstones. The driver shouted, the horses went on, pulled one end
of a bar, which was fastened by the other end to a big axle standing
erect in the middle of the great millstones; the bar again turned the
axle to which the upper millstone was fastened, and the millstones
began to grind the water-softened clay, crushing its smallest
particles. Our Lump no longer existed, but all its little particles which
before formed it were now like clay-jelly, and kept close together.
Ah, how they suffered! The awful millstone pressed upon them with
its whole weight—squeezed, flattened, ground them. They
shrivelled, groaned, cried from pain and said: 'Oh-o-o! what a
torture! it is all over with us!'
But that was not all. After the grinding the clay-jelly was poured by
means of gutters into the empty wooden tub to settle. There the
hard particles, heavier than water, sank.... On the bottom was the
sand, next the reddish clay, mixed with iron-rust, then the coarser
parts of the white clay, and finally its lightest particles, quite free
from all other mixture. All the particles of our Lump happened to be
of the same weight and to be nicely ground; they sank together and
formed again the same Lump, only soft, delicate, and free from all
unnecessary admixture. It was very nice, of course, but the little
Lump was so tired from all it suffered, so exhausted, that it did not
wish to live in the world. 'I would rather death would come!' it said.
Death, however, did not come. A workman came instead, poured off
the water which was on the surface of the clay, cut the clay to the
bottom, separated it into layers, and assorted them, so that the
upper, more delicate layer was for the best china vessels, and the
lower for the coarser plates. As our Lump was in the upper layer, it
was taken to a workman who made the finest vessels.
The workman took our Lump, put it into the middle of a round table
which turned on its centre, made this table spin round with his feet,
and at the same time pressed the clay here and there till he had
made a coarse cup without a handle. The workman then, with an
instrument like a knife, began to turn the cup, till it became a fine,
fine one. He then handed it to his neighbour, who put a nice little
handle to it. 'Well,' thought the Lump, transformed now into a cup,
'it is not so bad. I suffered indeed, but what a beauty I am now!' ...
and the Cup looked self-contentedly around. She did not rejoice
long. She was soon put with others into one of the pots of particular
form called 'muffles,' and the muffles were put into a furnace, which
began to heat the Cup by scorching degrees to make it red hot. 'Oh,
how hot it is!' stammered the poor Cup, perspiring, crying, and
groaning at once. 'Oh, what a torture! Oh, how hard it is to live in
the world! I should like to die!'
Still, she did not die. She was taken from the furnace, watered with
a certain mixture, burnt once more. A charming bouquet and
garland were then painted on her, and the Cup did not recognise
herself. 'Ah, how happy I am!' said she to herself; 'it was worth while
to suffer all that I suffered. I am the most beautiful here, and there
is and will be no one happier.'
Very soon the Cup went from the factory to the shop. She was
delighted to see the fine hall with large windows and nice glass
cases. She enjoyed the society of china cups, teapots, plates, and all
sorts of most beautiful things.
'Here,' thought she, 'they can appreciate my beauty!' and she
immediately addressed her neighbour, a big, round teapot: 'Please,
sir, have you been long here?'
'Yes,' answered the teapot gruffly, knocking with his coarse lid.
'And do you think there was ever before a cup with such fine
ornament and delicate painting as I have?'
'Ho-ho-ho-ha-ha!' ... laughed the big teapot. 'Just listen!' shouted he
to his companions, as big and coarse as himself; 'this damsel is
asking whether there is in the world a beauty like her?... O-ho-ho-
ho!'
'Ha-ha-ha-ha-ha!' burst all the big teapots in laughter, holding their
sides with their handles.
Our Cup was offended, and ashamed to tears.
'What are you laughing at?' whispered she in confusion.
'And how can we help laughing?' exclaimed her neighbour; 'you
think too much of yourself; and what are you good for? To spend all
your life on some nice shelf; you need cheapness and solidity to be
of some use. And as for your ornament, look to your right, on the
third shelf; there are more elegant ones there than you!'
The Cup looked to the right, and would have grown green from envy
if she could have changed colour. There were standing fine cups on
small feet; such delicate, fine cups, like white, pale, and pink rose
petals! ... the beautiful bouquets, the prettiest heads, the finest gold
lace, with black and green ornamentation, were painted upon them.
These cups were also proud of their beauty, and as they were more
beautiful than their new companion, they looked at her with
contempt and haughtiness.
In the china factory the Cup thought herself the most beautiful in
the world, and was quite happy; and now she was forced not only to
acknowledge that there were more beautiful ones, but to listen to
the mocking words and endure the most offensive looks. Envy,
vexation, shame, tormented her, and she would fain run away
somewhere, yet she could not move from the spot. This helplessness
added still to her pain and anger. She would like to have sunk into
the earth. 'Ah,' thought she, 'why did I not die before! Why does
death not come now!'
Death did not come, however. The shop door opened, a fine lady,
with a richly-dressed young girl of about ten years of age, came in.
'We want a nice cup, not too expensive,' said the lady to the
shopman at the counter.
The shopman took our Cup and some others from the shelf and put
them on the counter. Oh, what our Cup felt at that moment! She
was displayed with half a dozen of her companions, every one of
whom thought herself more beautiful than the others, and was
proud of it. Suppose these elegant purchasers should give the
preference not to her, but to one of her conceited companions? She
felt as if on burning coals. The little girl stretched her hand to one of
our Cup's neighbours, and the Cup trembled with anxiety. But the
little purchaser only touched the rival of our Cup and finally took the
latter. 'This one, mamma,' said the child, and the mother bought her.
Oh, with what a pride shone now this plaything, and how haughtily
she looked at her companions! Her beauty is now openly
acknowledged; she is preferred to others! She was bright with
happiness, and slightly trembled when the shopman took her from
the counter to wrap her in paper.
'Ah, how happy I am!' said the Cup in the evening, when fragrant
tea was poured in, and all who were sitting at the tea-table admired
her; 'of course there is and will be nobody happier than I.'
Just at this moment the pretty little girl who had chosen her at the
shop came running in from the garden. She was very thirsty. She
seized the Cup and took a sip at once, notwithstanding that they
cried to her that the tea was too hot. The Cup certainly was not to
blame that the girl from her own carelessness had scalded her
mouth, and the girl treated her unjustly. 'Oh, you nasty Cup!' cried
she, and threw her to the floor.
Crash! ... and the pieces of the poor innocent Cup tinkled plaintively,
and drops of tea, like big tears, trickled on to the floor from her. The
footman came, gathered the pieces of the broken Cup and threw
them away into the backyard on the rubbish heap. There she was
with the bits of old leather, broken glass, rusty pieces of tin, and a
pair of decaying cucumbers. She shivered from contact with the dirt,
which she had never experienced since she was a nice cup, and she
felt sick from the unpleasant odour. 'Oh, how unhappy I am!' said
the broken Cup. 'All is over. I have nothing to expect from life. I have
only to die!'
The Cup did not lie long in the rubbish heap. Early, early the next
morning, when all were yet asleep in the house, there came into the
backyard a poor, wrinkled, dirty, ragged, old woman. She had on her
back a bag, and a big stick with a hook on its end in her hand. She
was a rag-gatherer. She dug into the heaps with her hook, picked
out of them the bones, rags, paper, nails, pieces of glass, and such
things thrown away as seemed to the poor woman of some use.
After having filled up the bag, the rag-gatherer went home, sorted
its contents, and then took the bones to the shoeblacking maker,
rags and paper to the pasteboard maker, the iron to the dealer in old
iron, and the glass to the glass factory. All these places were far
from each other and from her lodging, and the poor woman was
exceedingly tired in going from one place to another. She gained
thus a few copecks,[1] without which neither she nor her sick
granddaughter would have had anything to eat. On the following
morning the old woman went again to dig among the heaps.
Coming near the rubbish heap where the broken Cup was lying, the
woman began to work with her hook, seeking with her old, tearful,
short-sighted eyes something worth having. She had already dug up
all that she wanted, when her hook struck against something hard;
the old woman knew by this sound that there was something like
glass in the heap. She stooped down and took up a fragment of the
Cup with a nice nosegay on it.
'What fine flowers!' whispered she; 'I will take it home for Mary—a
nice plaything for her—I must take it.'
The good old woman smiled, as she thought of her beloved
granddaughter, called Mary. She began to search again among the
rubbish, and found that there were many fine pieces, and those not
too small. 'Oh, the pieces are all here,' said she; 'it is possible
perhaps to cement them together.' And taking all the bits she put
them by themselves into the pocket of her worn-out petticoat.
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!

ebookball.com

You might also like