100% found this document useful (1 vote)
182 views

Download Complete Data Structures & Algorithms in Python John Canning PDF for All Chapters

Structures

Uploaded by

vavratihn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
182 views

Download Complete Data Structures & Algorithms in Python John Canning PDF for All Chapters

Structures

Uploaded by

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

Get ebook downloads in full at ebookmeta.

com

Data Structures & Algorithms in Python John


Canning

https://ebookmeta.com/product/data-structures-algorithms-in-
python-john-canning/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Data Structures and Algorithms with Python: With an


Introduction to Multiprocessing (Undergraduate Topics in
Computer Science) Lee
https://ebookmeta.com/product/data-structures-and-algorithms-with-
python-with-an-introduction-to-multiprocessing-undergraduate-topics-
in-computer-science-lee/
ebookmeta.com

Data Structures & Algorithms using Kotlin, Second Edition


Hemant Jain

https://ebookmeta.com/product/data-structures-algorithms-using-kotlin-
second-edition-hemant-jain/

ebookmeta.com

Problem Solving in Data Structures Algorithms Using C 2nd


Edition Hemant Jain

https://ebookmeta.com/product/problem-solving-in-data-structures-
algorithms-using-c-2nd-edition-hemant-jain/

ebookmeta.com

Insight Guides Scandinavia 5th Edition Insight Guides

https://ebookmeta.com/product/insight-guides-scandinavia-5th-edition-
insight-guides/

ebookmeta.com
International Relations Theory 1st Edition Mykola
Kapitonenko

https://ebookmeta.com/product/international-relations-theory-1st-
edition-mykola-kapitonenko/

ebookmeta.com

Tiresian name Inbida T siendiel 01 overview 2400 dpi First


Edition Studio Ammonite

https://ebookmeta.com/product/tiresian-name-inbida-t-
siendiel-01-overview-2400-dpi-first-edition-studio-ammonite/

ebookmeta.com

Analysis of Composite Laminates: Theories and Their


Applications 1st Edition Dinghe Li

https://ebookmeta.com/product/analysis-of-composite-laminates-
theories-and-their-applications-1st-edition-dinghe-li/

ebookmeta.com

Captured by the Magi 1st Edition Jl Madore Ruby Night

https://ebookmeta.com/product/captured-by-the-magi-1st-edition-jl-
madore-ruby-night/

ebookmeta.com

This Pact is Not Ours 1st Edition Zachary Sergi

https://ebookmeta.com/product/this-pact-is-not-ours-1st-edition-
zachary-sergi/

ebookmeta.com
Singing for Dummies 3rd Edition Pamelia S. Phillips

https://ebookmeta.com/product/singing-for-dummies-3rd-edition-pamelia-
s-phillips/

ebookmeta.com
Data Structures & Algorithms in Python
Data Structures & Algorithms in
Python

John Canning
Alan Broder
Robert Lafore

Boston • Columbus • New York • San Francisco • Amsterdam • Cape Town


Dubai • London • Madrid • Milan • Munich • Paris • Montreal • Toronto • Delhi • Mexico City
São Paulo • Sidney • Hong Kong • Seoul • Singapore • Taipei • Tokyo
Many of the designations used by manufacturers and sellers to distinguish their products are claimed
as trademarks. Where those designations appear in this book, and the publisher was aware of a
trademark claim, the designations have been printed with initial capital letters or in all capitals.
The authors and publisher have taken care in the preparation of this book, but make no expressed or
implied warranty of any kind and assume no responsibility for errors or omissions. No liability is
assumed for incidental or consequential damages in connection with or arising out of the use of the
information or programs contained herein.
For information about buying this title in bulk quantities, or for special sales opportunities (which
may include electronic versions; custom cover designs; and content particular to your business,
training goals, marketing focus, or branding interests), please contact our corporate sales department
at [email protected] or (800) 382-3419.
For government sales inquiries, please contact [email protected].
For questions about sales outside the U.S., please contact [email protected].
Visit us on the Web: informit.com/aw
Library of Congress Control Number: 2022910068
Copyright © 2023 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by
copyright, and permission must be obtained from the publisher prior to any prohibited reproduction,
storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical,
photocopying, recording, or likewise. For information regarding permissions, request forms and the
appropriate contacts within the Pearson Education Global Rights & Permissions Department, please
visit www.pearsoned.com/permissions/.
ISBN-13: 978-0-13-485568-4
ISBN-10: 0-13-485568-X
ScoutAutomatedPrintCode
Editor-in-Chief
Mark Taub
Director, ITP Product Management
Brett Bartow
Acquisitions Editor
Kim Spenceley
Development Editor
Chris Zahn
Managing Editor
Sandra Schroeder
Project Editor
Mandie Frank
Copy Editor
Chuck Hutchinson
Indexer
Proofreader
Editorial Assistant
Cindy Teeters
Designer
Chuti Prasertsith
Compositor
codeMantra
Pearson’s Commitment to
Diversity, Equity, and Inclusion
Pearson is dedicated to creating bias-free content that reflects the diversity
of all learners. We embrace the many dimensions of diversity, including but
not limited to race, ethnicity, gender, socioeconomic status, ability, age,
sexual orientation, and religious or political beliefs.
Education is a powerful force for equity and change in our world. It has the
potential to deliver opportunities that improve lives and enable economic
mobility. As we work with authors to create content for every product and
service, we acknowledge our responsibility to demonstrate inclusivity and
incorporate diverse scholarship so that everyone can achieve their potential
through learning. As the world’s leading learning company, we have a duty
to help drive change and live up to our purpose to help more people create a
better life for themselves and to create a better world.
Our ambition is to purposefully contribute to a world where
• Everyone has an equitable and lifelong opportunity to succeed
through learning
• Our educational products and services are inclusive and represent the
rich diversity of learners
• Our educational content accurately reflects the histories and
experiences of the learners we serve
• Our educational content prompts deeper discussions with learners and
motivates them to expand their own learning (and worldview)
While we work hard to present unbiased content, we want to hear from you
about any concerns or needs with this Pearson product so that we can
investigate and address them.
Please contact us with concerns about any potential bias at
https://www.pearson.com/report-bias.html.
To my mother, who gave me a thirst for knowledge, to my father, who
taught me the joys of engineering, and to June, who made it possible to
pursue both.

John Canning

For my father Sol Broder, a computer science pioneer, who inspired me to


follow in his footsteps.

To my mother Marilyn Broder, for showing me the satisfaction of teaching


others.

To Fran, for making my life complete.

Alan Broder
Contents
1. Overview

2. Arrays

3. Simple Sorting

4. Stacks and Queues

5. Linked Lists

6. Recursion

7. Advanced Sorting

8. Binary Trees

9. 2-3-4 Trees and External Storage

10. AVL and Red-Black Trees

11. Hash Tables

12. Spatial Data Structures

13. Heaps

14. Graphs

15. Weighted Graphs

16. What to Use and Why


Appendix A. Running the Visualizations

Appendix B. Further Reading

Appendix C. Answers to Questions


Table of Contents
1. Overview
What Are Data Structures and Algorithms?
Overview of Data Structures
Overview of Algorithms
Some Definitions
Programming in Python
Object-Oriented Programming
Summary
Questions
Experiments

2. Arrays
The Array Visualization Tool
Using Python Lists to Implement the Array Class
The Ordered Array Visualization Tool
Python Code for an Ordered Array Class
Logarithms
Storing Objects
Big O Notation
Why Not Use Arrays for Everything?
Summary
Questions
Experiments
Programming Projects

3. Simple Sorting
How Would You Do It?
Bubble Sort
Selection Sort
nsertion Sort
Comparing the Simple Sorts
Summary
Questions
Experiments
Programming Projects

4. Stacks and Queues


Different Structures for Different Use Cases
Stacks
Queues
Priority Queues
Parsing Arithmetic Expressions
Summary
Questions
Experiments
Programming Projects

5. Linked Lists
Links
The Linked List Visualization Tool
A Simple Linked List
Linked List Efficiency
Abstract Data Types and Objects
Ordered Lists
Doubly Linked Lists
Circular Lists
terators
Summary
Questions
Experiments
Programming Projects
6. Recursion
Triangular Numbers
Factorials
Anagrams
A Recursive Binary Search
The Tower of Hanoi
Sorting with mergesort
Eliminating Recursion
Some Interesting Recursive Applications
Summary
Questions
Experiments
Programming Projects

7. Advanced Sorting
Shellsort
Partitioning
Quicksort
Degenerates to O(N2) Performance
Radix Sort
Timsort
Summary
Questions
Experiments
Programming Projects

8. Binary Trees
Why Use Binary Trees?
Tree Terminology
An Analogy
How Do Binary Search Trees Work?
Finding a Node
nserting a Node
Traversing the Tree
Finding Minimum and Maximum Key Values
Deleting a Node
The Efficiency of Binary Search Trees
Trees Represented as Arrays
Printing Trees
Duplicate Keys
The BinarySearchTreeTester.py Program
The Huffman Code
Summary
Questions
Experiments
Programming Projects

9. 2-3-4 Trees and External Storage


ntroduction to 2-3-4 Trees
The Tree234 Visualization Tool
Python Code for a 2-3-4 Tree
Efficiency of 2-3-4 Trees
-3 Trees
External Storage
Summary
Questions
Experiments
Programming Projects

10. AVL and Red-Black Trees


Our Approach to the Discussion
Balanced and Unbalanced Trees
AVL Trees
The Efficiency of AVL Trees
Red-Black Trees
Using the Red-Black Tree Visualization Tool
Experimenting with the Visualization Tool
Rotations in Red-Black Trees
nserting a New Node
Deletion
The Efficiency of Red-Black Trees
-3-4 Trees and Red-Black Trees
Red-Black Tree Implementation
Summary
Questions
Experiments
Programming Projects

11. Hash Tables


ntroduction to Hashing
Open Addressing
Separate Chaining
Hash Functions
Hashing Efficiency
Hashing and External Storage
Summary
Questions
Experiments
Programming Projects

12. Spatial Data Structures


Spatial Data
Computing Distances Between Points
Circles and Bounding Boxes
Searching Spatial Data
Lists of Points
Grids
Quadtrees
Theoretical Performance and Optimizations
Practical Considerations
Further Extensions
Summary
Other documents randomly have
different content
First Morning after Confinement.—June 27, Six o’clock.—Mrs. E.
slept sweetly and soundly during the whole night, waking only a few
minutes at one time. She feels greatly refreshed, and able to rise and
take a bath; judges by her feelings that she will be benefited by sitting
up; has a good appetite. I advise her to sit up as much of the time,
little by little, as she feels inclined. She proposes eating very
sparingly of well-boiled cracked wheat, with a little uncooked milk
and berries.
Half-past Nine, P. M.—Mrs. E. has sat up at different times during
the day. No after-pains or particular discomfort of any kind. Every
time of sitting up has done her good. She has taken food at three
different times. Will take a sponging now, and retire to rest.
Second Morning after the Birth.—Mrs. E. slept remarkably well
during the whole night. Has been up, performed a bath, walked
about the room, and is much invigorated. Felt decidedly the need of
the bath; it strengthened her much. Has no after-pains or difficulty
of the breasts. The milk secretes abundantly. The bowels are moved
by injections of tepid water. Mrs. E. will sit up the greater part of the
day.
Third Morning after Birth.—Eleven, A. M.—Mrs. E. rested well
during the night. Arose at six, and took her usual bath. Reclines now
awhile. Would be able to walk up and down stairs were it necessary.
Her infant is remarkably well, and sleeps the greater part of the time.
Mrs. E. is one of that very small number of mothers that has energy
of character, resolution, and system enough to nurse her infant
regularly, and not during the night time. Once in three hours,
between 6 A. M. and 9 P. M., at the very most, is as often as she will
allow it to take the breast.
Seventh Day.—Mrs. E. has been improving day by day, from the
first. She has had no inconvenience whatever; no pains of any kind,
no swelling of the breasts or feverishness. Has well-nigh her natural
amount of strength. Her infant, too, is doing remarkably well.
Case III.—Nov., 1845.—Mrs. C., a poor woman of this city, not long
since made known to me, that in her destitute condition she would
receive, as a great favor, if I would attend her in childbirth. She
informed me that on previous like occasions, she had suffered
beyond description, both at the time of confinement and
subsequently. She had borne two children—the first it was necessary
for her physician to destroy before the birth could take place. The
birth of the second was also attended with the greatest difficulty. It
was now some weeks before her expected time. Her husband had
deserted her, so that she was compelled to follow her occupation
(that of a seamstress) during the whole day and much of the night.
From this constant sitting and confinement within doors, she had
become much enfeebled, and had a severe and constant pain in the
side.
I directed her to wash the whole body daily twice, when not chilly,
in Croton water, and to take each half day as much exercise in the
open air as she could possibly find time for, and could practice
without causing too great fatigue. The woman followed the
directions, and was at once sensibly benefited. The severe pain in the
side left her almost immediately. When her period arrived, delivery
took place in a very short time, and with comparatively little
suffering. Bathing in mild forms was practiced the day of, and
subsequent to, delivery, and the patient walked about each day, and
was scarcely confined a single hour.
There is one fact to be mentioned in her management of the infant.
She was directed at first to have it washed in tepid water. Supposing
she would follow the same course for the future daily washings, I
made no further inquiry till some days after, when I ascertained that
she had used the water of the natural temperature. I asked her why
she did not moderate the temperature of the water as at first, and as
people generally do. She answered, that when she bathed herself
before the child’s birth, every bath seemed to strengthen it very
much; and, therefore, she chose to use the cold water now for the
same reason. She had the good sense always to keep the child
sufficiently warm, particularly after the bath. It is proper to mention
that the Croton water at this time was not far from 65° Fah. The child
has been, and is now, one of the healthiest and most vigorous I have
ever seen of the age.
The above notes were written some months since. The case is
again brought to mind, by the mother’s coming to-day to work for us
at her usual occupation. She says, “What a strange thing it is, my
little baby has never been sick a single hour. What wouldn’t I give if
my other boy could have been so.” The child is one of the brightest
imaginable; knowing, observing, good-natured, and now, at the age
of six months, sits near his mother, playing, laughing, crowing—the
most perfect picture of health. He is every day once, and generally
twice, washed in cold water.
Case IV.—Oct. 25, 1847.—The same woman was again confined
early last spring. She had been living, I found, in a small cellar-room,
where there were but three small panes of glass, and to which the sun
could never come. The place was damp and dark, and the air
necessarily very foul, it being in an alley in which many poor, dirty
families were living. Here the poor woman lived, paying an
exorbitant rent, supporting herself and two children by the hardest
work rather than beg.
The night of her confinement was a very stormy one. The wind
howled among the old buildings, tearing off shingles and shutters,
and the rain poured down in perfect torrents. Ships were lost that
night, and sailors, with the captain and officers, swept overboard.
The labor this time, as before, was an easy one. It took place at
midnight. Every thing went on well, and she was, after a reasonable
time, left to get sleep, as we supposed she would. I found, however,
in the morning, that, notwithstanding she had been wholly free from
pain, she had not slept at all. She acknowledged that, powerful as
had been the effects of water for good at the previous time, the old
ideas had yet haunted her, that she must either die, or submit to the
application of those terrible instruments that had been used in her
first confinement. She now felt so rejoiced at her getting through
again safely, that she could not sleep at all. So we found her in the
morning early, she, her two children, and the new-born babe, all on
one narrow settee bed together, apparently contented and happy.
Two ladies who understood these matters of water-treatment,
went now, it being Saturday morning, and administered our patient a
bath. The water was moderated a little, but left still quite cool. This
day she could obtain no sleep, for she had but one room, and the
children must remain there. She sat up considerably, but not so
much as to cause over-fatigue. In the evening the ladies went again,
and administered the bath. She slept well during the night. The next
morning, Sunday (the second day), the ablution was administered at
7 o’clock, at which time the patient arose. She remained up all day,
until 10 o’clock in the evening, at which time the ladies again
administered the bath. She slept well this night, was up all the next
day, and so onward, and has been constantly well up to the present
time.
Case V.—Dec. 12, 1845.—Was called in the night between one and
two, by Mr. Brown, living at 40 Oliver-st., to visit his wife, then in
labor. At the beginning of the evening previous, Mrs. B. began to
experience premonitory symptoms—took, as usual, a sitting-bath,
reclined upon the bed, and slept about three hours, when she was
awakened at 10 o’clock by labor pains. These occurred regularly until
the time of our arrival and onward, growing more and more
effectual, until four in the morning, at which time she gave birth to a
fine healthy daughter. The after-birth was cast off in a few minutes,
after which Mrs. B. felt easy and inclined to rest. After being made
comfortable, she was desired to sleep awhile, and was told that she
would be refreshed and invigorated by an ablution after sleep, and
that she would be able to sit up a short time by way of a change.
Nine, P. M.—Returned to see Mrs. B. Found her quite comfortable,
after-pains slight; had slept a part of the time. From the
commencement of labor she had drank as freely of Croton water as
was desired—had drank nothing but cold water for about a year. Had
she been accustomed to warm or hot drinks there would have been a
liability to increase of after-pains by taking cold water. In such cases
the drink must be warm, unless there is much feverishness and
thirst, in which the cold drink would be tolerated and most
agreeable. Appetite was good. Mrs. B. said she could relish any thing;
was very fond of Indian mush, with a little syrup; thought she had
better not take any thing till dinner time—she would drink water,
and be on the safe side. To this I of course agreed. She felt none of
the giddiness, nervousness, great weakness, and depression of spirits
she had always hitherto felt after childbirth. There was now and then
a slight after-pain. She sits up little by little, and drinks water when
she feels an inclination. She will take food once to-day, that is dinner,
and I will come again by evening.
Seven, P. M.—Returned again. Mrs. Brown has been sitting up and
bearing her weight at different times during the day. She ate of the
plain favorite dish, Indian mush and molasses, with a piece of dry
bread, and water to drink. The bread tasted very sweet, the appetite
was so good. The husband had now returned, and the bathing could
be carried out. A wash-tub was brought into the room, and placed
before the fire to be warmed. At the same time, water, warm and
cold, was procured. A stick of wood was placed under one side of the
tub, and thus the two-fold object of a hip and general rubbing-bath
could be accomplished at the same time. Mrs. B. walked to the tub,
and, her husband aiding, took a good bath. The water was made
mild, of about 80° or 85° Fah.; while sitting in the bath, the body
being well guarded all about with blankets, a good deal of rubbing
was practiced upon different parts of the system, and particularly the
back. This had the effect of promoting after-pains, and of
strengthening the part, and in fact the whole system, very much. The
lower extremities were, of course, outside the tub, and those were
bathed afterward. A night-bath of this kind at such times seems,
indeed, to increase the strength tenfold. Pains are relieved, the
nerves strengthened, and a wonderful change wrought.
Second Day (Sunday), between Eight and Nine, A. M.—Mrs. B.
slept well during the night, and until late this morning. All were in
bed so long, and as Mrs. B. appeared so well, it was thought best, for
want of time, to omit the general bath until toward dinner. Told her
that, for a change, it would be best to go occasionally to other parts of
the house; but to be careful not to overdo, or to be up too long. At
any time pain or weakness was felt in the back, a good rubbing of the
part with the wet hand or towel would prove very serviceable.
Requested Mr. Brown that an enema of tepid water be administered.
This could be repeated twice if necessary to cause the desired effect.
Six o’clock, P. M.—Mrs. B. has eaten to-day sparingly twice, a
breakfast and dinner, the last with her family. Has walked up and
down stairs without inconvenience or assistance.
Third Day (Wednesday), A. M.—Mrs. B. rested well last night.
Feeling a little fatigue the preceding evening, she concluded to omit
the bath. It would have been refreshing, however, but this morning
she feels remarkably well, and has been doing light work. Has been
up nearly all the morning. Took the sitting and general rubbing-bath
early before breakfast. Was cautioned not to be up or to do too much.
Food to be plain, as usual, and the drink, cold water.
Seven, P. M.—Mrs. B. has been up most of the day. Appetite
remarkably good; thinks she took a little cold by sitting
unconsciously in a draught of air. A carious tooth commenced
aching, which proved a warning. There has been some feverishness,
probably nothing more than milk fever. This will be prevented by the
tepid-bath, the latter to be repeated as often as the feverishness
returns, if such should be the case. There has been some caking and
pain in the breasts. The pain is effectually removed by perseverance
in placing very warm or hot wet napkins upon the breasts, covering
these with dry warm flannels, and repeating them very often until the
pain is relieved. Breasts to be well drawn, and the bowels moved by a
full injection of tepid water. If Mrs. B. perseveres as she always has,
she will have a good night’s rest.
Fourth Day.—Mrs. B. rested well; continues the baths, plain diet,
sitting up, and moderate exercise, as usual, and is progressing
rapidly toward firm health and strength.
Fifth, Sixth, and Seventh Days.—Mrs. B. proceeded cautiously,
and with the most favorable results.
Eighth Day, Eleven, A. M.—Mrs. B. has been about all the
morning, has been giving way to her great propensity to industry,
practicing at the wash-tub. She does not believe at all in idleness. The
only danger is that she may do too much.
Ninth Day.—Mrs. B. is about as usual; feels that she has an
abundance of strength to walk some distance in the city. She could
walk out with impunity, notwithstanding the weather is very cold,
but it is thought best, on the whole, since she is so much about
house, and pays so much attention to bathing and ventilation, that
she should remain within doors yet, a little.
She says that at the end of three weeks from the birth of the child
next older, when beginning to attempt to sit up, she was weaker than
she has been at any moment since the birth of the last one. With all
her children she has been very weak.
Case VI.—Late in the month of January, of the present year (1850),
I was called early in the morning to visit a young married lady, in
Fourth Avenue, who was said to be in great suffering from spasms
and vomiting. She had not slept during the night, and it was
necessary for her husband to remain up with her the whole time. I
found her with very high general fever, and oft-recurring spasms,
attended with bilious vomiting. The fact of her being in an advanced
stage of pregnancy, with this complication of untoward symptoms
upon her, designated the case too clearly to a practiced observer, as
being one of both delicacy and danger. The parties in the case had no
knowledge whatever of the water-cure, or of my particular methods
of treatment, and had called me, being the nearest physician, and, as
they supposed, of the old school. No medicines had as yet been
administered, but the patient, as is common on such occasions, had
been deluged with a great variety of articles, in the way of liquid food
and drinks, with the hope of “settling the stomach,” a process which
can seldom succeed, and, as often practiced, is quite sufficient of
itself to make even a well person sick.
The patient and her husband both thought, as a matter of course,
that “some physic must be given.” I told them we would first give a
tepid-bath, at 70° Fah. This I assured them would give great relief,
and knowing well, too, the great prejudice among English people (for
they were English) against bathing in pregnancy, I aided the
husband, with my own hands, in administering it, thus to be certain
of its being well and faithfully done. This they both thought at the
time a rather harsh method of treatment; but they had employed the
doctor, and he being resolute and determined, they could not refuse.
The bath gave great relief, and then, all shivering and cold, a very
large wet girdle was put upon the patient, after which she was
wrapped warmly in bed, with moderately warm bricks to the feet.
After having allowed the patient to rest awhile, a large injection
was administered, and with the best effect. Occasionally, too,
retching still occurred (for symptoms of this kind never cease
suddenly, and, indeed, should not), at which times tepid water was
given freely to drink, for the purpose of aiding vomiting.
Thus the treatment was pursued: as the symptoms appeared to
demand, the tepid half-bath, with a good deal of friction, the wet
girdle, constantly or nearly so, the injections, and the water-drinking
were kept up. From the first moment onward, the patient recovered
as rapidly as could be desired. She slept a good deal during the day,
and also well at night. The next morning she was quite well, although
weak. She then commenced taking nourishment gradually. No
further serious troubles were experienced during the period of
pregnancy.
The 4th of April, 1850, the above-mentioned lady, at about the end
of eight months of pregnancy, as was supposed was delivered. There
was more or less of pain during thirty-six hours previous to the birth.
The pains were rather severe during the most of twenty-four hours,
proving that good health, with abundant exercise and bathing, are
not necessarily of themselves capable of causing short and easy
labor.
The child was born at about five o’clock in the afternoon. Soon a
thorough ablution was performed in the sitting-bath. No patient ever
had a better understanding of what was necessary in the case, and
none, certainly, could be more free from all sensations of false
modesty or delicacy; nor could any one pursue the treatment with
greater confidence than she did. There was no time when she could
not easily sit up or stand, if necessary, and, with the good nursing of
her husband, she improved most rapidly. She wore the wet girdle
most of the time, alternating, however, now and then, with simple
fomentations. She bathed four times during the first twenty-four
hours after the birth, washing the whole body thoroughly at each
time, the water being moderated to from 60° to 70° Fah. She sat up
during this time about six hours in all, and walked by spells a little in
her room. She suffered somewhat with after-pains, but the means
before mentioned, together with injections to the bowels, generally
brought relief. All along her appetite and sleep were good.
The second day the patient sat up most of the time, and walked to
other parts of the house, and for an hour and a half visited a friend.
She could have gone abroad in the open air, had it been necessary for
her so to do.
The third morning, that is, when her infant was two and a half
days old, the patient walked with her husband a distance of about
three fourths of a mile, visiting a friend. She was fatigued somewhat,
but, on the whole, benefited by the undertaking.
After this, she walked abroad in the open air daily, always having
to go down from the third story of the house in which she lived. In
one week she went about the city, teaching her scholars in French,
German, music, etc., as she had done up to the very day of labor.
And now, to exhibit things in their true light, let this lady’s case, as
it occurred under water-treatment, be contrasted with the drug-
treatment employed on a previous like occasion.
Between two and three years before, she was pregnant with her
first child. Then, as during the last time, she was attacked with
cramps, vomiting, and fever. She was laid by a fire in an almost
insensible state, and had mustard draughts placed over a large part
of the surface. She was also dosed a good deal internally, and
salivated with calomel.
At labor, as well as during pregnancy, she was attended by one of
the best physicians of London. It was three weeks before she could
leave her bed; in four weeks she left her room for the first, and did
not go out of the house until six weeks had elapsed. She was then no
stronger than in two days after confinement, under water-
treatment.
Here, then, was a great difference in the result of the two methods
—a difference so great that it cannot possibly be appreciated, except
by those who have actually experienced them in their own persons.
One fact more should be mentioned in this case; the lady had been
exceedingly depressed in mind through the whole, or most of the
period; she, with her husband, having left the Old World for the New.
A combination of circumstances most perplexing and depressing had
worked upon her mind, and she was haunted perpetually with the
idea that she must die a stranger in a strange country. Thus things
went on till about nine weeks before she was confined, or the time
before-mentioned, of her acute illness. But no sooner were the laws
of life, health, and disease unfolded to her ever-active and intelligent
mind, than she at once set resolutely and cheerfully to the
performing of every task. No item in the way of bathing, exercise,
diet, etc., was ever omitted. The story of her case tells whether or not
she was rewarded for her faithfulness.
Case VII.—Early in the morning of the 22d of May, 1850, I was
called to visit a lady of this city, about thirty years of age, far
advanced in her sixth pregnancy. She had, during this period, as
before, been much in the habit of taking alcoholic stimulants,
principally in the form of brandy, judging, from her feelings, she
needed the stimulus. But its only effect was to render her at all times
much more liable to take on inflammatory disease.
Four days before I was called, this lady was taken with very severe
bilious vomiting, and cramp of the stomach. Two physicians were
consulted, and a variety of medicines used. Still the patient
continued, day by day, to grow worse, and could get neither relief nor
sleep. Being told that she was in danger of convulsions, she and her
husband concluded they would change their physician and try the
water-treatment.
I found the patient then retching and vomiting almost incessantly,
the stomach cramping, the bowels constipated, with high general
fever and flush of countenance, the pulse being 130 per minute, or
about double its normal beat, and the patient had not slept for three
days.
Treatment.—This was very simple. The whole body was well
washed in water at about 80° Fah., a full clyster was administered,
and wet, cooling fomentations were put freely over the chest and
abdomen. Almost immediately the patient experienced a short but
refreshing sleep. The cloths were changed often, the surface was
sponged as it became too hot or uncomfortable. The general washing
in the wash-tub was practiced once in four hours from the first,
which always brought sleep. When retching and nausea came on,
tepid water was taken freely to help the vomiting. This gave great
relief. No other drink than water was taken, and no food until the
vomiting had ceased. After this, well-boiled Indian-meal gruel was
given, beginning with a single tea-spoonful at first, and then
increasing the quantity as could be borne, at the next regular meal-
time. After the first day the patient was bathed three or four times in
the twenty-four hours. The clysters and fomentations were continued
as circumstances required. No very cold water was used in any form.
In three days’ time the patient was up and about, and in all
respects quite well, though somewhat weak.
Eleven days after commencing the treatment in the above case,
namely, on Sunday morning, the 2d of June, 1850, the patient was
taken very suddenly in labor. Within half an hour after the very first
sensation of any pain, and before her husband could call me, her
child was born, a sixth son. She suffered but little, and was delivered
while in the standing posture, but the after-birth remained unborn. I
found her weeping for fear that she would be subjected to some
horrible water-applications, of which she had read. I told her that my
mode of practice was altogether different from that which she so
much feared, and that, at any rate, no honest physician would ever
subject a patient to any process which she could not heartily concur
in. I told her, moreover, that I would much prefer that she should
have her old physician if she chose, and that she could not possibly
offend me if she would but frankly take her own choice. Her husband
then desired that she would pursue that course which she herself
preferred. With the explanation I had given, she concluded at once to
go on with the matter as I might see fit to advise. “Well,” said I to
myself, “we will see how a mixed treatment will answer—a little of
the old, and a little of the new.”
The patient was perfectly willing to be bathed in tepid water, which
I also advised. But she wanted the old-fashioned obstetrical bandage
or binder, as she had used it before. I explained to her all about its
nature and effects, and consented that she might use it if she would
take it off at each time of bathing, and at all times when she found it
causing too great heat. Her husband bathed her four times the first
day in bed; the women would not help at all. She was able to sit up in
bed, and the second day and onward, she bathed herself, the old
nurse always making herself absent at the time. She had suffered
with after-pains before, but nothing worth mentioning this time.
Injections were used from time to time, and the wet towels over the
abdomen. The second day the patient was up in her room. The third
morning, as I went to her door, I heard some one singing, and, on
entering, found it was the patient herself, alone, sitting up with her
infant in her arms.
The fourth morning the lady was so well that there was no excuse
for a doctor any more. She said she had to keep her room, and mostly
her bed, for four weeks always before. Now in three days she was
perfectly well, bathing herself repeatedly every day; whereas always
before she had never dared wash herself short of a whole month, and
then only with whisky! She was now convinced that the only safe
way to prevent taking cold, was to bathe.
This, then, may be put down as a remarkable case. Eleven days
before labor the patient was very dangerously sick. The birth was
exceedingly easy and short; and, although such labors are not, on the
whole, as safe as those which are more difficult and protracted, she
yet recovered her usual health in a remarkably short period of time,
and without any mishap or pain. She bathed but very little,
comparatively, although that little told well. No application whatever
of cold water was made.
Case VIII.—While the cholera was committing its fearful ravages
in the city of Brooklyn, during the summer of 1849, a worthy and
intelligent lady, the wife of a sea captain, was preparing to leave for
the country, whither I was to go with her to attend her looked-for
case of childbirth. Monday, the 9th day of July, she was busy packing
trunks and preparing to move, and probably overworked. At all
events, she did not feel well, and experienced pains similar to those
of labor, all day Tuesday. I remained in the house over night, but in
the morning the patient was better. Still there occurred at times
periodical pains, and I told the patient that if they were true and
natural pains of labor, a bath would accelerate and make them
worse; or if they were false pains, and such as did not indicate the
near approach of labor, the bath would cure or render them less.
They were, however, increased.
At eight o’clock in the evening labor came to a close, the result
being a fine, healthy, female child. One hour after, namely, at 9
o’clock, the patient feeling rested, was helped into a sitting-bath tub,
and well washed, for some minutes, over the whole surface. The
water was fresh and cool from the cistern. As may be imagined, the
patient felt incomparably more comfortable after a good cleansing in
this manner, and a degree of refreshment that can be conceived of
only by those who have had the practical illustration of it in their
own persons, was experienced. A plenty of wet linen towels were
placed over the abdomen and genitals, and by these means the
patient was enabled to pass, on the whole, a very good night.
She had, she informed me, always suffered intolerable anguish for
days after the birth of her other children, five or six in number, I
believe. Even with the first—a thing very uncommon—she had
experienced most severe torture. It was therefore a great object at
this time to do every thing possible to prevent the after-pains.
Toward morning, as she began to grow more warm, the pains came
on in a slight degree.
At 6½ o’clock (the 12th, the first morning after the birth), the
patient was again thoroughly washed from head to foot in the hip-
tub. After this a large linen sheet, the whole being wet, and folded in
the form of a very large girdle (large enough to cover the whole trunk
of the body), was employed. It was wrapped round from end to end,
its object being to act as a great and moderately cooling, and
necessarily soothing fomentation, to the body, to keep off
inflammation and subdue pain. The weather being most excessively
sultry and hot, only one dry sheet was placed over her as a covering.
She was to remain in this condition so long as the wet sheet did not
become uncomfortable or too warm. At 10 the same forenoon, after
having slept a good nap, a second ablution was practiced.
She now took a trifle of nourishment in the form of oatmeal gruel,
the first since the birth of the child. The two whole days previous,
likewise, she had not eaten in all the amount of half a common meal.
This three days’ abstinence proved a most valuable means in warding
off fever and pain. Nor did it materially impair the strength.
In the afternoon of the same day (the 12th) the patient again took a
good bath, fresh from the cistern. She slept considerably both
forenoon and afternoon, and suffered positively no more pain. She
sat up in her rocking-chair to rest herself in the afternoon and
evening, at which time still another bath was to be repeated; but
feeling so comfortable, and sleeping withal, she concluded to omit it.
The next morning (the 13th) the patient sat up and took her
breakfast, namely, a small piece of simple brown-bread toast.
Thus she went on, bathing and using the fomentations freely each
and every day, and very soon regained her full strength. Indeed, she
was not at any time so weak as to prevent her walking. She always,
after the first night, appeared happy, cheerful, and smiling. She now
had no pains whatever, while always before, in childbed, she had
suffered greatly for many days after the birth.
The peculiarities of this case are the following:
1. The patient bathed during the whole period of pregnancy daily,
by means of that invaluable application, the dripping or rubbing wet-
sheet.
2. She wore, of her own accord, the wet compress over the stomach
the whole time of pregnancy, night and day; a means which seemed
most effectually to prevent heart-burn, nausea, and a host of
stomach difficulties, to which she had on previous like occasions
been subject.
3. The very abstemious diet subsisted on. She ate much of the time
but little else than brown bread and water, and this in small quantity.
4. The extreme heat of the weather.
5. The fact that epidemic cholera was raging most fearfully at the
time, in the same neighborhood.
6. The great amount of treatment that was practiced.
7. The freedom from all after-pains, to which the patient had on all
previous like occasions been subject.
8. The great rapidity with which she recovered her full strength.
Let those who would imitate a treatment of this kind, be sure of
the principles on which they act. Experience is the great teacher in
these things. The timid and inexperienced must be content to
practice in a less heroic mode.
Case IX.—July 15, 1850.—This is the case of a lady who resided in
our establishment, about thirty years of age, of delicate health, and
scrofulous tendency. She bathed through her whole period, and paid
tolerable regard to diet, but was too much encumbered with
domestic duties to allow of suitable exercise in the open air. This was
her second pregnancy.
She came to labor very suddenly on the evening of the above date—
labor lasting only about half an hour. The pains were exceedingly
severe. The presentation of the child was an obscure one, but I
succeeded in bringing down the feet foremost, and then, by
arranging successively the body and the head in a proper position, I
met with no serious obstacle in effecting the delivery. The after-birth
came away in a short time, with very little manual aid. Cold wet
cloths were at once placed over the abdomen, genitals, and thighs,
and often renewed. There were some after-pains. After resting half
an hour, the patient was raised as she desired, placed in a hip-bath,
and thoroughly washed all over with water, temperature of the
Croton, and which produced an effect which she designated as
“heavenly.” A folded wet sheet was placed about her body, and being
left in a condition which would not allow of her becoming either too
hot or too cold, she soon slept sweetly. She had also slept somewhat
before the bath. Changing the wet application from time to time, she
obtained a very good night’s rest.
The next day she used the wet applications according to her
feelings of comfort, and was washed four times thoroughly from
head to foot in a hip-bath. Immediately after the first bath, early in
the morning, she sat in a rocking-chair, had water brought to her,
and then washed her infant, unaided, with her own hands, because
no one could perform this important duty so well as herself; she
continued so to do daily from the first.
She was herself bathed three or four times daily until she was
perfectly recovered, which was in a very short time. She sat up four
hours the first day, and so onward. Her infant did remarkably well.
About midsummer, 1847, this same lady was confined, under my
care. Not long before the beginning of pregnancy at that time, she
had suffered from a very severe attack of fever; but by dint of
perseverance in good habits, she got along very well through the
period, though the labor was a severe one, and the perineum became
torn. There was likewise some trouble from swelling of the breasts.
But notwithstanding these drawbacks, she was able to sit up, walked
out very soon, and on the whole recovered remarkably well. The
sitting-bath and wet compresses had evidently a very salutary effect
in healing the perineum; the child also thrived well. This lady had
been some years, for the most part, a vegetarian, and drinks neither
tea nor coffee.
Case X.—July 31, 1850.—A lady residing in a healthy part of the
country was confined the tenth time at this date. She ate no flesh-
meat during pregnancy; the diet was entirely vegetable, including the
different kinds of berries and fruits in their season; her drink pure
water only.
Living thus, she was able to attend to the dairy, making her own
butter, and performing all the cooking herself for a family of eleven
persons, up to the very day of her confinement.
Labor commenced in the evening, and soon after, at the
recommendation of her husband, she was sponged over the whole
surface with cold spring water, and soon after took a cold sitting-
bath. In about an hour after this she was delivered of a fine plump
boy weighing ten pounds. After resting a little, and being somewhat
fatigued and suffering some pain, her husband proposed another
ablution, to which she readily consented. After this she slept well till
sunrise the next morning. The wet girdle had been worn nights some
time previous to labor, and was continued about a week after it.
The first morning she was washed all over, and felt very
comfortable after it. She partook of rye-bread toast and blue-berries,
with water for drink; this was her whole breakfast, and her appetite
was good. At night she took a sitz-bath for five minutes, the chill
taken off the water, then sponged the body and retired to rest; she
slept well all night. She had no nurse but her husband.
The second morning she experienced no pain; followed the course
of the preceding day, namely, the bathing of the body and the sitz-
bath washing; partook of unleavened wheat-meal cakes for breakfast,
with good ripe berries; for dinner, corn-bread with berries; supper,
dry toast made of brown bread, with blue-berries; no drink at any
time but the best of pure cold water. The third morning she walked
about the room; helped to bathe herself; appetite good; food pretty
much the same as the day previous; spent a large share of the day
sewing; sitz-bath washing as usual at night. The fourth day she was
able to bathe and dress herself, partook of meals with the family, and
kept about house all day.
From this time forward she took the entire care of her child;
neither mother nor child have taken one particle of medicine, nor
any herb drinks of any kind or name, and both have been perfectly
well and regular in all their habits up to this time, it being two
months since the birth. All that the child has ever had was two or
three tea-spoonsful of cold water at the time of its birth; after which
it was put to the breast. I ought to mention that the child has also,
from the very first, been washed every morning in water made
slightly tepid.
Case XI.—This is the case of a newly-married lady of this city,
twenty-four years of age, of nervous temperament, studious habits,
and highly sensitive but well-balanced mind. She had been for years
engaged in teaching in the South, and suffered very much with
dyspepsia. She had followed water-treatment, pretty thoroughly, one
year before she became pregnant. The first four months of this
period, it being the winter season, she took the sitting-bath an half
hour every morning in cold water, and after it bathed the whole
body. During the day she wore a large wet girdle, covering the whole
trunk of the body, always during the day rewetting before it became
dry; at night it was left off.
She experienced at first much trouble from nausea and
prostration.
By the use of the wet girdle, the sitting-bath, and general washing,
in connection with abstinence—for she passed whole days eating not
more than a fourth part of a Boston cracker in the twenty-four hours
—she soon got the mastery of her stomach-sickness, and other
troubles.
After the first four months she took the half-hour sitting-bath and
general washing three times daily, and wore the large wet girdle as
before. She was active in her habits, and for the greater part of the
time appeared in as good health as ever in her life before. She
remained in the city until the summer, and then left for the country.
About the middle of August, 1850, as she was on the point of
returning to the city to make ready for her approaching confinement,
under my care, she met with a fall. This brought on labor some weeks
earlier, as she supposed, than it should have been. It was rather
severe, lasting twenty-four hours. She took ether, as is the custom
with many in New England, where she was—an unnatural and
injurious practice as I regard it to be. Her child was born on the
morning of the 15th of August, soon after midnight. During labor she
ate nothing, bathed a number of times, and took clysters of water, all
of which served to refresh the system.
In less than an hour after the birth, she was helped into the tub;
sat some ten minutes in the water, and was washed over the whole
surface. She could easily have borne her weight. The wet girdle was
applied, and other cooling fomentations, after which she slept
soundly till morning.
She was then bathed again, as before, and after this washed her
infant herself, and dressed it the first time, and thereafter continued
daily to take the care of it.
She took daily three baths in the wash-tub, the water always at
about 70° Fah., and continued to wear the wet girdle and compresses
night and day the whole of the first two weeks.
The first day she sat up half an hour, besides taking the baths. She
could easily have remained up a large share of the time, but being
among those who knew nothing of water-treatment, she preferred
being on the safe side. The second day she sat up an hour, and felt
well and strong. The first and second days she ate almost nothing.
The third day she was up all the time, and took her meals with the
family. The fourth day she walked out, and visited two families near.
The fifth day she carried her child in her arms, walking with perfect
ease a quarter of a mile, and feeling no fatigue. During the first days
she had some trouble with swelling of the breasts. Cold water was
poured upon them a good deal, and wet compresses worn. She also
persevered much in drawing them herself with the tobacco pipe, and
by these means conquered the difficulty readily. In three weeks she
was able to travel alone with the infant, some 250 miles, to this city.
She came first about four miles in a stage coach, thence by railroad to
the steamboat, thence over night to the city, and then rode nearly or
quite three miles over the rough pavements in the morning to her
city home, it being just three weeks to a day from the birth of her
infant.
This worthy and intelligent lady remarked, that she considered it
her duty to make known to the world her experience in the water-
treatment. She said “that many suppose they cannot avail themselves
of the advantages of the new method, for the reason that they are not
within the reach of a physician who is competent to practice it. But,”
she continued, “there is not a lady in the whole United States who
may not readily learn as much about it as I myself did. I gained all
my knowledge from books, and had never for once conversed with
any one who had gone through with the treatment in childbirth.”
Great good must necessarily be accomplished if women will but read,
understand, and practice, carefully and intelligently, for themselves.
Case XII.—A lady of delicate health and small stature, twenty-nine
years of age, came to our establishment in the autumn of 1850, to be
confined with her first child. On the 5th of November, considering
herself within a week or ten days of confinement, she went, by my
permission, in company with her husband, to hear Jenny Lind, at
Tripler Hall. She slept well during the night after the concert, and at
six the next morning she was awakened by pains resembling labor.
These gradually increased until her child was born, a little after
eleven in the forenoon, her labor being, on the whole, an easy one.
Two hours after the delivery she was taken up, and bathed
thoroughly in a sitting-bath tub, the water at 70°. Being delicate, it
caused her a good deal of shivering at the time; but this amounted to
no harm, and usually occurs during a number of the first baths after
delivery. At evening she was again bathed as before, and slept well
during the night. Cold wet compresses were used freely, as according
to our custom in such cases.
The second day, and onward, she was bathed four times—before
breakfast, dinner, and supper, and on going to rest. She was able,
also, to sit up more or less daily, and the first three days went on, in
all respects, apparently well.
The fourth day, in the afternoon, there occurred a circumstance of
ominous character, such as I hope it may be my lot seldom to
encounter. I refer to the coming on of that most fearful malady,
puerperal fever—the puerperal plague, as it has been appropriately
called. The patient was already somewhat feverish, which was caused
probably by the new excitement of milk in her system.
At the same time some relatives came to see her, it being the first
time of their visiting her after the birth. They were in high glee,
joking, talking, laughing, and making all manner of fun for a
considerable time. All this transpired without my knowledge.
At the edge of evening, I found the patient in a most terrific fever;
her flesh was very hot, face flushed, pains in the back, abdomen, and
head; the pulse full and throbbing at 140 per minute. Judge my
surprise at these phenomena, knowing, as I did, that the patient had
been remarkably well in the morning; I had not yet learned of the
excitement she had undergone during the afternoon.
It is evident enough, I think, that under such circumstances, some
powerful and decided means must be resorted to; otherwise the
disease might proceed so rapidly as to destroy the patient’s life, and
that too, possibly, within twenty-four hours.
We commenced the treatment by giving her a thorough ablution in
water, a little tepid at first. She was then placed in a heavy linen
sheet but moderately wrung from cold water, and packed loosely,
with but little covering. The object of these applications was
gradually to cool the system; to bring down the pulse, as soon as
might be, to its natural standard; to arrest the inflammation that was
already going on in the abdomen; and to quell the pains. The wet
sheet was changed every twenty to thirty minutes. Gradually the
pulse became less frequent, and the pains less, till midnight, when
we had succeeded in bringing the pulse permanently down to 80,
and the pains were quite gone. The wet sheet was then folded each
way, making it four double, and placed about the patient’s body,
from the arms downward; in this she was to sleep the remainder of
the night, having just covering enough to keep her comfortable. But
if she should become wakeful from pain or feverishness, the husband
was to renew it, that is, rewet it in cold water, and as often as
necessary. Once or twice only it was changed before morning.
The reader who is at all acquainted with the danger and the
fearfulness of this most awful disease, may form some idea of the
anxiety I felt when I first found this patient with the attack upon her.
He may judge, too, something of my feelings, when, by midnight, I
had succeeded in bringing the pulse down to 80, and quelling all
fever and pain.
The next morning the patient appeared in all respects well, but
somewhat weak, and not a little blanched. She got along afterward in
all respects perfectly well.
In a very short time—I do not now remember in how many days
after the birth—she commenced walking out carefully, and riding in
the city to improve her strength, with a view of returning home as
soon as circumstances might warrant.
When her infant was nineteen days old, feeling in all respects
strong and well—as much so, perhaps, as ever in her life—she
proceeded, in company with a female attendant, on her journey
homeward, about three hundred miles.
I should remark that this patient was always of weak, nervous, and
delicate constitution. She had had a miscarriage three years before
this confinement, which weakened her a good deal. During this
second pregnancy she adopted the water-treatment under my
directions, but was obliged to use, both for bathing and drinking as
well as other purposes, very hard, limy water—a circumstance
considerably against her. She experienced numerous little ailments,
but on the whole got along very well.
Case XIII.—Nov. 8, 1850.—A lady residing in the city of Brooklyn,
of small stature, tolerably good constitution, nervous temperament,
and I should judge about twenty-five or six years of age, gave birth to
her third child near midnight of the above date. Having suffered a
good deal at her last preceding confinement, particularly with after-
pains, she had resolved at this time to adopt the water-treatment.
Very soon after the birth, the placenta having been expelled soon
after the child, the most fearful after-pains commenced, precisely in
the same way the patient had suffered before; and she had doubtless,

You might also like