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

Download Building Java Programs: A Back to Basics Approach Stuart Reges ebook All Chapters PDF

Building

Uploaded by

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

Download Building Java Programs: A Back to Basics Approach Stuart Reges ebook All Chapters PDF

Building

Uploaded by

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

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Building Java Programs: A Back to Basics Approach


Stuart Reges

https://textbookfull.com/product/building-java-programs-a-
back-to-basics-approach-stuart-reges/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


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

Building Java Programs - A Back to Basics Approach Stuart


Reges

https://textbookfull.com/product/building-java-programs-a-back-to-
basics-approach-stuart-reges-2/

textboxfull.com

Building Java Programs: A Back to Basics Approach, 5th


Edition Stuart Reges

https://textbookfull.com/product/building-java-programs-a-back-to-
basics-approach-5th-edition-stuart-reges/

textboxfull.com

Building Python Programs 1st Edition Stuart Reges

https://textbookfull.com/product/building-python-programs-1st-edition-
stuart-reges/

textboxfull.com

Simpler Living Back to Basics Guides 2nd Edition Jeff


Davidson

https://textbookfull.com/product/simpler-living-back-to-basics-
guides-2nd-edition-jeff-davidson/

textboxfull.com
College physics : a strategic approach 4th Edition Stuart
Field

https://textbookfull.com/product/college-physics-a-strategic-
approach-4th-edition-stuart-field/

textboxfull.com

Artificial Intelligence: A Modern Approach 4th Edition


Stuart Russell

https://textbookfull.com/product/artificial-intelligence-a-modern-
approach-4th-edition-stuart-russell/

textboxfull.com

RESTful Java Web Services A pragmatic guide to designing


and building RESTful APIs using Java 3rd Edition
Balachandar
https://textbookfull.com/product/restful-java-web-services-a-
pragmatic-guide-to-designing-and-building-restful-apis-using-java-3rd-
edition-balachandar/
textboxfull.com

A Functional Approach to Java: Augmenting Object-Oriented


Java Code with Functional Principles 1st Edition Ben
Weidig
https://textbookfull.com/product/a-functional-approach-to-java-
augmenting-object-oriented-java-code-with-functional-principles-1st-
edition-ben-weidig/
textboxfull.com

Back Trouble A New Approach to Prevention and Recovery


based on the Alexander Technique Deborah Caplan

https://textbookfull.com/product/back-trouble-a-new-approach-to-
prevention-and-recovery-based-on-the-alexander-technique-deborah-
caplan/
textboxfull.com
Building Java Programs
A Back to Basics Approach

Fourth Edition

Stuart Reges

University of Washington

Marty Stepp

Stanford University

Boston Columbus Indianapolis New York San Francisco Hoboken


Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal
Toronto Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore
Taipei Tokyo
Vice President, Editorial Director: Marcia Horton

Acquisitions Editor: Matt Goldstein

Editorial Assistant: Kristy Alaura

VP of Marketing: Christy Lesko

Director of Field Marketing: Tim Galligan

Product Marketing Manager: Bram Van Kempen

Field Marketing Manager: Demetrius Hall

Marketing Assistant: Jon Bryant

Director of Product Management: Erin Gregg

Team Lead, Program and Project Management: Scott Disanno

Program Manager: Carole Snyder

Project Manager: Lakeside Editorial Services L.L.C.

Senior Specialist, Program Planning and Support: Maura Zaldivar-Garcia

Cover Design: Joyce Wells

R&P Manager: Rachel Youdelman

R&P Project Manager: Timothy Nicholls

Inventory Manager: Meredith Maresca

Cover Art: Matt Walford/Cultura/Getty Images

Full-Service Project Management: Apoorva Goel/Cenveo Publisher


Services
Composition: Cenveo® Publisher Services

Printer/Binder: Edwards Brothers Malloy

Cover Printer: Phoenix Color

Text Font: Monotype

The authors and publisher of this book have used their best efforts in
preparing this book. These efforts include the development, research, and
testing of the theories and programs to determine their effectiveness. The
authors and publisher make no warranty of any kind, expressed or implied,
with regard to these programs or to the documentation contained in this book.
The authors and publisher shall not be liable in any event for incidental or
consequential damages in connection with, or arising out of, the furnishing,
performance, or use of these programs.

Copyright © 2017, 2014 and 2011 Pearson Education, Inc. or its affiliates.
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 transmission in any form or by any means, electronic, mechanical,
photocopying, recording, or otherwise. For information regarding
permissions, request forms and the appropriate contacts within the Pearson
Education Global Rights & Permissions department, please visit
www.pearsonhighed.com/permissions/.

Acknowledgements of third party content appear on pages 1193–1194, which


constitute an extension of this copyright page.

PEARSON, and MYPROGRAMMINGLAB are exclusive trademarks in the


U.S. and/or other countries owned by Pearson Education, Inc. or its affiliates.

Unless otherwise indicated herein, any third-party trademarks that may


appear in this work are the property of their respective owners and any
references to third-party trademarks, logos or other trade dress are for
demonstrative or descriptive purposes only. Such references are not intended
to imply any sponsorship, endorsement, authorization, or promotion of
Pearson's products by the owners of such marks, or any relationship between
the owner and Pearson Education, Inc. or its affiliates, authors, licensees or
distributors.

Library of Congress Cataloging-in-Publication Data

Names: Reges, Stuart, author. | Stepp, Martin, author.

Title: Building Java programs : a back to basics approach / Stuart Reges,


University of Washington; Marty Stepp, Stanford University.

Description: Fourth Edition. | Hoboken, NJ : Pearson, 2016.

Identifiers: LCCN 2015049340 | ISBN 9780134322766 (alk. paper)

Subjects: LCSH: Java (Computer program language)

Classification: LCC QA76.73.J38 R447 2016 | DDC 005.13/3—dc23 LC


record available at http://lccn.loc.gov/2015049340

10 9 8 7 6 5 4 3 2 1

ISBN 10: 0-13-432276-2

ISBN 13: 978-0-13-432276-6


Preface
The newly revised fourth edition of our Building Java Programs textbook is
designed for use in a two-course introduction to computer science. We have
class-tested it with thousands of undergraduates, most of whom were not
computer science majors, in our CS1-CS2 sequence at the University of
Washington. These courses are experiencing record enrollments, and other
schools that have adopted our textbook report that students are succeeding
with our approach.

Introductory computer science courses are often seen as “killer” courses with
high failure rates. But as Douglas Adams says in The Hitchhiker's Guide to
the Galaxy, “Don't panic.” Students can master this material if they can learn
it gradually. Our textbook uses a layered approach to introduce new syntax
and concepts over multiple chapters.

Our textbook uses an “objects later” approach where programming


fundamentals and procedural decomposition are taught before diving into
object-oriented programming. We have championed this approach, which we
sometimes call “back to basics,” and have seen through years of experience
that a broad range of scientists, engineers, and others can learn how to
program in a procedural manner. Once we have built a solid foundation of
procedural techniques, we turn to object-oriented programming. By the end
of the course, students will have learned about both styles of programming.

Here are some of the changes that we have made in the fourth edition:

New chapter on functional programming with Java 8. As explained


below, we have introduced a chapter that uses the new language features
available in Java 8 to discuss the core concepts of functional
programming.

New section on images and 2D pixel array manipulation. Image


manipulation is becoming increasingly popular, so we have expanded
our DrawingPanel class to include features that support manipulating
images as two-dimensional arrays of pixel values. This extra coverage
will be particularly helpful for students taking an AP/CS A course
because of the heavy emphasis on two-dimensional arrays on the AP
exam.

Expanded self-checks and programming exercises. Many chapters have


received new self-check problems and programming exercises. There
are roughly fifty total problems and exercises per chapter, all of which
have been class-tested with real students and have solutions provided for
instructors on our web site.

Since the publication of our third edition, Java 8 has been released. This new
version supports a style of programming known as functional programming
that is gaining in popularity because of its ability to simply express complex
algorithms that are more easily executed in parallel on machines with
multiple processors. ACM and IEEE have released new guidelines for
undergraduate computer science curricula, including a strong
recommendation to cover functional programming concepts.

We have added a new Chapter 19 that covers most of the functional concepts
from the new curriculum guidelines. The focus is on concepts, not on
language features. As a result, it provides an introduction to several new Java
8 constructs but not a comprehensive coverage of all new language features.
This provides flexibility to instructors since functional programming features
can be covered as an advanced independent topic, incorporated along the
way, or skipped entirely. Instructors can choose to start covering functional
constructs along with traditional constructs as early as Chapter 6. See the
dependency chart at the end of this section.

The following features have been retained from previous editions:

Focus on problem solving. Many textbooks focus on language details


when they introduce new constructs. We focus instead on problem
solving. What new problems can be solved with each construct? What
pitfalls are novices likely to encounter along the way? What are the most
common ways to use a new construct?

Emphasis on algorithmic thinking. Our procedural approach allows us to


emphasize algorithmic problem solving: breaking a large problem into
smaller problems, using pseudocode to refine an algorithm, and
grappling with the challenge of expressing a large program
algorithmically.

Layered approach. Programming in Java involves many concepts that


are difficult to learn all at once. Teaching Java to a novice is like trying
to build a house of cards. Each new card has to be placed carefully. If
the process is rushed and you try to place too many cards at once, the
entire structure collapses. We teach new concepts gradually, layer by
layer, allowing students to expand their understanding at a manageable
pace.

Case studies. We end most chapters with a significant case study that
shows students how to develop a complex program in stages and how to
test it as it is being developed. This structure allows us to demonstrate
each new programming construct in a rich context that can't be achieved
with short code examples. Several of the case studies were expanded
and improved in the second edition.

Utility as a CS1+CS2 textbook. In recent editions, we added chapters


that extend the coverage of the book to cover all of the topics from our
second course in computer science, making the book usable for a two-
course sequence. Chapters 12–19 explore recursion, searching and
sorting, stacks and queues, collection implementation, linked lists,
binary trees, hash tables, heaps, and more. Chapter 12 also received a
section on recursive backtracking, a powerful technique for exploring a
set of possibilities for solving problems such as 8 Queens and Sudoku.

Layers and Dependencies


Many introductory computer science books are language-oriented, but the
early chapters of our book are layered. For example, Java has many control
structures (including for-loops, while-loops, and if/else-statements), and
many books include all of these control structures in a single chapter. While
that might make sense to someone who already knows how to program, it can
be overwhelming for a novice who is learning how to program. We find that
it is much more effective to spread these control structures into different
chapters so that students learn one structure at a time rather than trying to
learn them all at once.

The following table shows how the layered approach works in the first six
chapters:

Control Programming
Chapter Data Input/Output
Flow Techniques
procedural
1 methods String literals println, print
decomposition
definite variables, local variables, class
2 loops expressions, constants,
(for) int, double pseudocode
console input, 2D
return
3 using objects parameters graphics
values
(optional)
conditional char pre/post conditions, printf
4
(if/else) throwing exceptions
indefinite
assertions, robust
5 loops boolean
programs
(while)
token/line-based file
6 Scanner file I/O
processing

Chapters 1–6 are designed to be worked through in order, with greater


flexibility of study then beginning in Chapter 7. Chapter 6 may be skipped,
although the case study in Chapter 7 involves reading from a file, a topic that
is covered in Chapter 6.

The following is a dependency chart for the book:


Supplements
http://www.buildingjavaprograms.com/

Answers to all self-check problems appear on our web site and are accessible
to anyone. Our web site has the following additional resources for students:

Online-only supplemental chapters, such as a chapter on creating


Graphical User Interfaces

Source code and data files for all case studies and other complete
program examples

The DrawingPanel class used in the optional graphics Supplement 3G

Our web site has the following additional resources for teachers:

PowerPoint slides suitable for lectures

Solutions to exercises and programming projects, along with homework


specification documents for many projects

Sample exams and solution keys

Additional lab exercises and programming exercises with solution keys

Closed lab creation tools to produce lab handouts with the instructor's
choice of problems integrated with the textbook

To access protected instructor resources, contact us at


authors@buildingjavaprograms.com. The same materials are also available at
http://www.pearsonhighered.com/cs-resources. To receive a password for this
site or to ask other questions related to resources, contact your Pearson sales
representative.

MyProgrammingLab
MyProgrammingLab is an online practice and assessment tool that helps
students fully grasp the logic, semantics, and syntax of programming.
Through practice exercises and immediate, personalized feedback,
MyProgrammingLab improves the programming competence of beginning
students who often struggle with basic concepts and paradigms of popular
high-level programming languages. A self-study and homework tool, the
MyProgrammingLab course consists of hundreds of small practice exercises
organized around the structure of this textbook. For students, the system
automatically detects errors in the logic and syntax of code submissions and
offers targeted hints that enable students to figure out what went wrong, and
why. For instructors, a comprehensive grade book tracks correct and
incorrect answers and stores the code inputted by students for review.

For a full demonstration, to see feedback from instructors and students, or to


adopt MyProgrammingLab for your course, visit the following web site:
http://www.myprogramminglab.com/

VideoNotes

We have recorded a series of instructional videos to accompany the textbook.


They are available at the following web site: www.pearsonhighered.com/cs-
resources

Roughly 3–4 videos are posted for each chapter. An icon in the margin of the
page indicates when a VideoNote is available for a given topic. In each video,
we spend 5–15 minutes walking through a particular concept or problem,
talking about the challenges and methods necessary to solve it. These videos
make a good supplement to the instruction given in lecture classes and in the
textbook. Your new copy of the textbook has an access code that will allow
you to view the videos.
Acknowledgments
First, we would like to thank the many colleagues, students, and teaching
assistants who have used and commented on early drafts of this text. We
could not have written this book without their input. Special thanks go to
Hélène Martin, who pored over early versions of our first edition chapters to
find errors and to identify rough patches that needed work. We would also
like to thank instructor Benson Limketkai for spending many hours
performing a technical proofread of the second edition.

Second, we would like to thank the talented pool of reviewers who guided us
in the process of creating this textbook:

Greg Anderson, Weber State University

Delroy A. Brinkerhoff, Weber State University

Ed Brunjes, Miramar Community College

Tom Capaul, Eastern Washington University

Tom Cortina, Carnegie Mellon University

Charles Dierbach, Towson University

H.E. Dunsmore, Purdue University

Michael Eckmann, Skidmore College

Mary Anne Egan, Siena College

Leonard J. Garrett, Temple University

Ahmad Ghafarian, North Georgia College & State University

Raj Gill, Anne Arundel Community College


Michael Hostetler, Park University

David Hovemeyer, York College of Pennsylvania

Chenglie Hu, Carroll College

Philip Isenhour, Virginia Polytechnic Institute

Andree Jacobson, University of New Mexico

David C. Kamper, Sr., Northeastern Illinois University

Simon G.M. Koo, University of San Diego

Evan Korth, New York University

Joan Krone, Denison University

John H.E.F. Lasseter, Fairfield University

Eric Matson, Wright State University

Kathryn S. McKinley, University of Texas, Austin

Jerry Mead, Bucknell University

George Medelinskas, Northern Essex Community College

John Neitzke, Truman State University

Dale E. Parson, Kutztown University

Richard E. Pattis, Carnegie Mellon University

Frederick Pratter, Eastern Oregon University

Roger Priebe, University of Texas, Austin

Dehu Qi, Lamar University


John Rager, Amherst College

Amala V.S. Rajan, Middlesex University

Craig Reinhart, California Lutheran University

Mike Scott, University of Texas, Austin

Alexa Sharp, Oberlin College

Tom Stokke, University of North Dakota

Leigh Ann Sudol, Fox Lane High School

Ronald F. Taylor, Wright State University

Andy Ray Terrel, University of Chicago

Scott Thede, DePauw University

Megan Thomas, California State University, Stanislaus

Dwight Tuinstra, SUNY Potsdam

Jeannie Turner, Sayre School

Tammy VanDeGrift, University of Portland

Thomas John VanDrunen, Wheaton College

Neal R. Wagner, University of Texas, San Antonio

Jiangping Wang, Webster University

Yang Wang, Missouri State University

Stephen Weiss, University of North Carolina at Chapel Hill

Laurie Werner, Miami University


Dianna Xu, Bryn Mawr College

Carol Zander, University of Washington, Bothell

Finally, we would like to thank the great staff at Pearson who helped produce
the book. Michelle Brown, Jeff Holcomb, Maurene Goo, Patty Mahtani,
Nancy Kotary, and Kathleen Kenny did great work preparing the first edition.
Our copy editors and the staff of Aptara Corp, including Heather Sisan, Brian
Baker, Brendan Short, and Rachel Head, caught many errors and improved
the quality of the writing. Marilyn Lloyd and Chelsea Bell served well as
project manager and editorial assistant respectively on prior editions. For
their help with the third edition we would like to thank Kayla Smith-Tarbox,
Production Project Manager, and Jenah Blitz-Stoehr, Computer Science
Editorial Assistant. Mohinder Singh and the staff at Aptara, Inc., were also
very helpful in the final production of the third edition. For their great work
on production of the fourth edition, we thank Louise Capulli and the staff of
Lakeside Editorial Services, along with Carole Snyder at Pearson. Special
thanks go to our lead editor at Pearson, Matt Goldstein, who has believed in
the concept of our book from day one. We couldn't have finished this job
without all of their hard work and support.

Stuart Reges

Marty Stepp
Break through
To Improving results

MyProgammingLab™
Through the power of practice and immediate personalized feedback,
MyProgrammingLab helps improve your students' performance.

Programming Practice
With MyProgrammingLab, your students will gain firs-hand programming
experience in an interactive online environment.

Immediate, Personalized Feedback


MyProgrammingLab automatically detects errors in the logic and syntax of
their code submission and offers targeted hints that enables students to figure
out what went wrong and why.

Graduated Complexity
MyProgrammingLab breaks down programming concepts into short,
understandable sequences of exercises. Within each sequence the level and
sophistication of the exercises increase gradually but steadily.
Dynamic Roster
Students' submissions are stored in a roster that indicates whether the
submission is correct, how many attempts were made, and the actual code
submissions from each attempt.

Pearson eText
The Pearson eText gives students access to their textbook anytime, anywhere

Step-By-Step Videonote Tutorials


These step-by-step video tutorials enhance the programming concepts
presented in select Pearson textbooks.
For more information and titles available with MyProgrammingLab, please
visit www.myprogramminglab.com.

Copyright © 2016 Pearson Education, Inc. or its affiliate(s). All rights


reserved. HELO88173 · 11/15

LOCATION OF VIDEO NOTES IN THE TEXT

www.pearsonhighered.com/cs-resources

Chapter 1 Pages 31, 40


Chapter 2 Pages 65, 74, 89, 97, 110
Chapter 3 Pages 141, 156, 161, 167
Chapter 3G Pages 197, 215
Chapter 4 Pages 243, 251, 278
Chapter 5 Pages 324, 327, 329, 333, 356
Chapter 6 Pages 396, 409, 423
Chapter 7 Pages 458, 465, 484, 505
Chapter 8 Pages 535, 547, 555, 568
Chapter 9 Pages 597, 610, 626
Chapter 10 Pages 672, 677, 686
Chapter 11 Pages 716, 729, 737
Chapter 12 Pages 764, 772, 809
Chapter 13 Pages 834, 837, 843
Chapter 14 Pages 889, 896
Chapter 15 Pages 930, 936, 940
Chapter 16 Pages 972, 979, 992
Chapter 17 Pages 1037, 1038, 1048
Chapter 18 Pages 1073, 1092
Brief Contents
1. Chapter 1 Introduction to Java Programming 1

2. Chapter 2 Primitive Data and Definite Loops 63

3. Chapter 3 Introduction to Parameters and Objects 137

4. Supplement 3G Graphics (Optional) 196

5. Chapter 4 Conditional Execution 238

6. Chapter 5 Program Logic and Indefinite Loops 315

7. Chapter 6 File Processing 387

8. Chapter 7 Arrays 443

9. Chapter 8 Classes 530

10. Chapter 9 Inheritance and Interfaces 587

11. Chapter 10 ArrayLists 662

12. Chapter 11 Java Collections Framework 715

13. Chapter 12 Recursion 754

14. Chapter 13 Searching and Sorting 832

15. Chapter 14 Stacks and Queues 884

16. Chapter 15 Implementing a Collection Class 922

17. Chapter 16 Linked Lists 965

18. Chapter 17 Binary Trees 1017


19. Chapter 18 Advanced Data Structures 1071

20. Chapter 19 Functional Programming with Java 1107

1. Appendix A Java Summary 1149

2. Appendix B The Java API Specification and Javadoc Comments 1164

3. Appendix C Additional Java Syntax 1170


Contents
1. Chapter 1 Introduction to Java Programming 1

1. 1.1 Basic Computing Concepts 2

1. Why Programming? 2

2. Hardware and Software 3

3. The Digital Realm 4

4. The Process of Programming 6

5. Why Java? 7

6. The Java Programming Environment 8

2. 1.2 And Now—Java 10

1. String Literals (Strings) 14

2. System.out.println 15

3. Escape Sequences 15

4. print versus println 17

5. Identifiers and Keywords 18

6. A Complex Example: DrawFigures1 20

7. Comments and Readability 21

3. 1.3 Program Errors 24

1. Syntax Errors 24
2. Logic Errors (Bugs) 28

4. 1.4 Procedural Decomposition 28

1. Static Methods 31

2. Flow of Control 34

3. Methods That Call Other Methods 36

4. An Example Runtime Error 39

5. 1.5 Case Study: DrawFigures 40

1. Structured Version 41

2. Final Version without Redundancy 43

3. Analysis of Flow of Execution 44

2. Chapter 2 Primitive Data and Definite Loops 63

1. 2.1 Basic Data Concepts 64

1. Primitive Types 64

2. Expressions 65

3. Literals 67

4. Arithmetic Operators 68

5. Precedence 70

6. Mixing Types and Casting 73

2. 2.2 Variables 74

1. Assignment/Declaration Variations 79
2. String Concatenation 82

3. Increment/Decrement Operators 84

4. Variables and Mixing Types 87

3. 2.3 The for Loop 89

1. Tracing for Loops 91

2. for Loop Patterns 95

3. Nested for Loops 97

4. 2.4 Managing Complexity 99

1. Scope 99

2. Pseudocode 105

3. Class Constants 108

5. 2.5 Case Study: Hourglass Figure 110

1. Problem Decomposition and Pseudocode 111

2. Initial Structured Version 113

3. Adding a Class Constant 114

4. Further Variations 117

3. Chapter 3 Introduction to Parameters and Objects 137

1. 3.1 Parameters 138

1. The Mechanics of Parameters 141

2. Limitations of Parameters 145


3. Multiple Parameters 148

4. Parameters versus Constants 151

5. Overloading of Methods 151

2. 3.2 Methods That Return Values 152

1. The Math Class 153

2. Defining Methods That Return Values 156

3. 3.3 Using Objects 160

1. String Objects 161

2. Interactive Programs and Scanner Objects 167

3. Sample Interactive Program 170

4. 3.4 Case Study: Projectile Trajectory 173

1. Unstructured Solution 177

2. Structured Solution 179

4. Supplement 3G Graphics (Optional) 196

1. 3G.1 Introduction to Graphics 197

1. DrawingPanel 197

2. Drawing Lines and Shapes 198

3. Colors 203

4. Drawing with Loops 206

5. Text and Fonts 210


6. Images 213

2. 3G.2 Procedural Decomposition with Graphics 215

1. A Larger Example: DrawDiamonds 216

3. 3G.3 Case Study: Pyramids 219

1. Unstructured Partial Solution 220

2. Generalizing the Drawing of Pyramids 222

3. Complete Structured Solution 223

5. Chapter 4 Conditional Execution 238

1. 4.1 if/else Statements 239

1. Relational Operators 241

2. Nested if/else Statements 243

3. Object Equality 250

4. Factoring if/else Statements 251

5. Testing Multiple Conditions 253

2. 4.2 Cumulative Algorithms 254

1. Cumulative Sum 254

2. Min/Max Loops 256

3. Cumulative Sum with if 260

4. Roundoff Errors 262

3. 4.3 Text Processing 265


1. The char Type 265

2. char versus int 266

3. Cumulative Text Algorithms 267

4. System.out.printf 269

4. 4.4 Methods with Conditional Execution 274

1. Preconditions and Postconditions 274

2. Throwing Exceptions 274

3. Revisiting Return Values 278

4. Reasoning about Paths 283

5. 4.5 Case Study: Body Mass Index 285

1. One-Person Unstructured Solution 286

2. Two-Person Unstructured Solution 289

3. Two-Person Structured Solution 291

4. Procedural Design Heuristics 295

6. Chapter 5 Program Logic and Indefinite Loops 315

1. 5.1 The while Loop 316

1. A Loop to Find the Smallest Divisor 317

2. Random Numbers 320

3. Simulations 324

4. do/while Loop 325


2. 5.2 Fencepost Algorithms 327

1. Sentinel Loops 329

2. Fencepost with if 330

3. 5.3 The boolean Type 333

1. Logical Operators 335

2. Short-Circuited Evaluation 338

3. boolean Variables and Flags 342

4. Boolean Zen 344

5. Negating Boolean Expressions 347

4. 5.4 User Errors 348

1. Scanner Lookahead 349

2. Handling User Errors 351

5. 5.5 Assertions and Program Logic 353

1. Reasoning about Assertions 355

2. A Detailed Assertions Example 356

6. 5.6 Case Study: NumberGuess 361

1. Initial Version without Hinting 361

2. Randomized Version with Hinting 363

3. Final Robust Version 367

7. Chapter 6 File Processing 387


Exploring the Variety of Random
Documents with Different Content
and more or less concealed by edematous surroundings, the picture
is more complete in one respect, although the details may be
obscure. From the mucous and softer tissues the disease will spread
and invade the cartilages themselves, as well as the tissues outside,
and so with the progress of the cancer the entire larynx becomes
fixed in a bed of infiltrated tissue extending in all directions,
involving the upper part of the trachea, the epiglottis, and the base
of the tongue. Meantime the loss of voice, the distressing cough,
and the other evidences of local invasion will have kept pace with
the progress of the disease, and dyspnea will come on sooner or
later as the passage-way becomes blocked, while from sudden,
violent efforts at coughing acute attacks of edema, which may result
fatally, are liable to occur.
Tumors of the trachea proper are far less common. They may be
benign or malignant. In either event they will prove to be of about
the same type as those already discussed above as occurring within
the larynx. They cause less interference with speech, but as much or
even more difficulty in respiration.
When tracheotomy was a frequent resort in croup and diphtheria a
peculiar form of new formation in the trachea was occasionally
encountered, resulting from the irritation of the trachea tube, whose
presence sometimes provokes excessive formation of granulation
tissue, whose subsequent contraction brings about not only the
formation of a dense granuloma, but cicatricial contraction. Hence in
the older literature references to granulation stenosis were common.
Now that intubation has almost completely replaced tracheotomy for
these purposes the latter is rarely performed, and tubes are seldom
left more than a day or two in situ, so that this kind of local
provocation, with its consequences, is rarely encountered.
It may be possible by expert use of the laryngoscope to see a
tumor located within the trachea. If the patient cannot tolerate its
use the parts may be made tolerant by the use of a weak cocaine
spray. Such a growth, if accessible from above, may be removed
through the glottis by forceps. Most operators, however, prefer to
make an opening through the trachea and thus profit by the larger
surgical opportunities thus afforded. Such an operation should be
made with the patient’s head low in order that blood may gravitate
to the pharynx rather than to the lungs.

OPERATIONS UPON THE LARYNX.


Cancer of the larynx was regarded, until the last quarter of the
previous century, as an absolutely hopeless condition for which
nothing could be done until it became necessary to do a
tracheotomy, this simply affording relief from some of the distressing
features, but aiding nowise to check the progress of the growth. The
first demonstration of the possibility of successful removal of the
larynx was made by Czerny, in 1870, upon dogs. Watson, of
Edinburgh, had removed a syphilitic larynx in toto in 1866, but this
summary operation only became known to the world through a
publication of Foulis in 1881. Meantime, Czerny’s experiments were
so successful that Billroth was induced to attempt the removal of the
entire larynx in a case of cancer, with results which astonished the
profession of that day. Thus introduced, nevertheless, the mortality
rate was great, the principal cause of death being inspiration
pneumonia—that is, rapid infection of the lung through the widely
opened trachea and the entrance of saliva and fluids from the
mouth. Hahn, of Berlin, undertook the improvement of the technique
and was able to reduce the mortality from this cause. Meantime
another radical method—namely, thyrotomy, i. e., opening the
laryngeal box—had not fared much better than the measure just
mentioned. Thus until about twenty-five years ago the radical
treatment of laryngeal cancer stood in an unpleasant light, partly
because diagnostic methods were unsatisfactory and our general
knowledge of the disease incomplete, partly because operation was
always delayed until late, and because operative measures had yet
to be much improved. Tremendous impetus was given to the whole
subject by the celebrated case of the Emperor Frederick, and the
acrimonious criticisms concerning its conduct were not without
benefit, since they led to a careful re-study of the whole situation,
with its numerous subsidiary questions, among which was the
possibility of transformation of a benign into a malignant tumor. At
present, largely through the labors of Hahn and Billroth, in Germany,
and Semon, in London, the question of operative procedures is fairly
settled, everyone now believing that the disease should be radically
attacked at the earliest possible moment, opinions differing only in
regard to the route which the surgeon should adopt, i. e., whether
he should make an intralaryngeal operation, as is now favored in
Germany; a thyrotomy, as preferred in Great Britain, or a
laryngectomy, as some of the general surgeons in all parts of the
world prefer.
The different methods of attack upon the larynx for cancer may
then be summarized as including intralaryngeal extirpation through
the natural passages, thyrotomy, and partial or complete
laryngectomy.
The intralaryngeal method, seen from the general surgeon’s view-
point, can only be suitably applied to a limited class of cases which
are recognized early, and may be best performed by an expert
laryngologist, i. e., one accustomed to instrumentation within the
pharynx and larynx. It includes the use of various instruments for
the excision of small areas, for the application of the galvanocautery,
etc. The writer agrees with Semon in regarding it as irreconcilable
with the principles which should guide us in dealing with malignant
growths, the fundamental one being the removal not only of the
growth itself but of an area of surrounding tissue. This intralaryngeal
method may then be satisfactory in the removal of benign growths,
but will seldom appeal to the operating surgeon when he deals with
cancer. Epithelioma may commence at the accessible tip of the
epiglottis, but intrinsic cancer of the larynx should be dealt with in a
more radical manner. Thyrotomy is the operation of choice,
especially among the British laryngologists. It seems rational to
believe that in cases where diagnosis is made early a thyrotomy,
with removal of the growth and a wide area of surrounding tissue,
including portions of cartilage, if necessary, may prove the ideal
operation, while vocal results are better than after extirpation. It is
necessary, however, that diagnosis should be made early and that
operation be made thoroughly; while if, after opening the thyroid, it
should appear that complete extirpation of the growth is otherwise
impossible, then the operator should make a complete laryngectomy.
All of these operations are best preceded by use of a cocaine
spray, by which extreme irritability of the interior of the larynx is
allayed, and the reflex lowering of blood pressure prevented. (See p.
178.)
Thyrotomy is performed as follows: The patient is preferably in the
position with down-hanging head. An incision in the median line,
about three inches in length, is made from the upper border of the
thyroid cartilage down to a point below the cricoid. With but slight
separation of the tissues it is made to extend directly down upon the
abrupt ridge-like anterior border of the thyroid cartilage, below
which will be exposed the cricothyroid membrane. Into this the knife
may be inserted and made, with cutting edge up, to split the halves
of the larynx exactly in the middle line, the blade passing between
the vocal cords, unless they have been much distorted by the
growth. In that case the dissection may be made more deliberately.
The larynx being thus split, the cricoid should be divided, after
which, with suitable retractors, the interior is exposed to such an
extent as to permit both inspection and palpation. Through the
opening thus afforded all suspicious tissue should be removed, from
one side or both, the primary question being not what will be the
resultant effect upon the voice, but how best to completely eradicate
the cancerous tissue. With the patient’s head hanging downward
there is less likelihood of the entrance of blood into the trachea.
Nevertheless the tampon cannula should always be accessible so
that it may be inserted should it be required. The tampon cannula is
a trachea tube around which there is a small rubber bag, with a tube
through which it may be inflated, so that after the cannula is
introduced into the trachea it may be tamponed by air pressure in
such a manner as to permit no passage of blood.
In the absence of one of these specially designed tubes an
effective substitute may be made by the ordinary trachea tube
wrapped with a covering of antiseptic gauze, the latter held in place
by a few turns of fine silk or catgut.
The thyrohyoid membrane bears the superior laryngeal vessels
and nerves, and it should be entered through the middle line in
order not to disturb these. Whatever operation may be required
upon the tissues within the laryngeal box may be conducted with
knife, scissors, curette, and the fine point of the actual cautery. The
interior of the larynx should be cleaned, leaving it simply as a part of
the respiratory tube, without reference to what may become of the
structures within it devoted to voice production. The cartilaginous
shell, with or without a part of its previous contents, having been rid
of the suspicious tissue within, it may be held together by one or
two sutures of silver wire or by superficial sutures of chromic gut,
while the trachea tube which may have been used may be left for a
day or two, or removed at the time. Ordinarily the latter course will
prove the better.
Laryngectomy, or total extirpation of the larynx, is the most severe
procedure of all, but will be requisite when there is evidence of
escape of malignant growth from within the true confines of the
laryngeal box. Not only the larynx but more or less of the
surrounding tissue may be removed, with infected neighboring
lymphatics, the upper portion of the trachea, and the base of the
tongue.
The operation may be preceded by a low tracheotomy or
otherwise. If necessary this should be done several days in advance,
in order that the patient may have become tolerant of the tube and
of the new method of breathing. If requisite the ordinary trachea
tube may be substituted for the tampon tube above described, in
which case it will not be necessary to lower the patient’s head.
Otherwise the operation is perhaps best performed with the head
and neck in the Rose position.
The incision is a long median division of tissues from above the
hyoid to an inch or more below the cricoid cartilage. Through it the
anterior border of the thyroid should be easily exposed. It is then
necessary to separate on either side the sternohyoid and
sternothyroid muscles, the lateral mass of the thyroid body being
drawn to either side along with the musculature, the isthmus having
been previously doubly ligated and divided for this purpose. Now as
rapidly as may be the larynx is completely isolated from all the
structures around it, the dissection being bluntly made. After freeing
it on both sides it is drawn forward, first to one side, then to the
other, so that on either side the superior laryngeal artery may be
exposed and secured, the superior laryngeal nerve being necessarily
divided. The cricothyroid branches need also to be secured, as well
as any other vessels which may spurt blood. Circumferential isolation
of the larynx is now completed by dividing the inferior constrictor of
the pharynx and separating it from the side of the thyroid, keeping
close to the cartilage. After this isolation is completed the surgeon
has the choice of first dividing the respiratory tube either above or
below the larynx. This will depend largely upon his own choice, but
usually the procedure is easier when the first division is made either
through the cricothyroid membrane or between the cricoid and the
upper ring of the trachea or even below this point, if necessary. With
a low division first the patient will immediately begin to breathe
through the opening thus made unless a previous tracheotomy has
been done. Ample time will be afforded for the introduction of a
trachea tube and protection around it to prevent entrance of blood,
when the larynx may be lifted and separated with knife or scissors
from the tissues remaining attached. The esophagus begins at the
level of the cricoid cartilage, and if the cricoid is to be removed the
esophagus should be separated from it; otherwise it is not disturbed.
Last of all, in this order, the thyrohyoid membrane will require
division, and then the extirpation is completed.
The wound is large, the communication with the oropharynx is
unobstructed, and there will be constant escape into the newly
formed cavity of secretions from the nose and mouth. At first the
patient will be unable to swallow, although there may be constant
desire to reflex attempts in this direction. The questions to be
decided are the management of the wound in gross and the suitable
treatment of the upper end of the trachea, as well as of the
esophagus, if this has been touched. The greatest danger is that of
inspiration pneumonia. Other consideration should be secondary to
that of prevention of the escape of fluids down the trachea and the
consequent production of pneumonia. General experience is rather
to the effect that the best results are obtained with a minimum of
sutures, the large cavity being lightly packed with absorbent
material, while the upper end of the trachea should be sewed to the
skin as high as possible on either side, the esophagus being allowed
to take care of itself. The patient should wear a trachea tube for
several days after the operation. Through the exposed upper end of
the esophagus a tube may be passed three or four times a day, and
sufficient nourishment be thus introduced into the stomach. The
patient may be kept lying upon the side for the greater part of the
time, so that saliva may escape from the mouth.
The question comes up later as to what substitute, if any, may be
afforded for the lost larynx. Gussenbauer devised an improvement
on what was called the “artificial larynx,” devised originally by Foulis
and then modified by Hahn, which afforded an ingenious mechanical
substitute for the larynx, permitting the production of voice by
vibration of a metallic reed, such tone as it produced being, like that
produced by the vocal cords, modified by the vocal organs above
into perfectly intelligible speech, but always in a monotone. It
consisted of a tracheal tube through whose external opening another
tube could be passed upward to a point where it lay beneath the
epiglottis, if this were left in situ, or behind the base of the tongue, if
the epiglottis had been removed. Through this the patient could
breathe under ordinary circumstances. By a little device at the
external opening the touch of the finger upon a spring would throw
into the air current a thin, metallic reed, by whose vibrations tone
was produced, to be modified as mentioned above. This was the
principle of the artificial larynx which was worn by many patients
and which in many gave good results. One patient of my own wore
one for seven years, although he discontinued using the reed
because the peculiarity of the tone attracted more attention than did
the loud “stage whisper” which he had cultivated. Around the
instrument there is always more or less moisture or discharge, and
there are many disagreeable features attending its use, even though
it permit the act of swallowing without any difficulty.
Solis Cohen introduced a method of treating these cases by
fastening the trachea to the external wound and permitting the
cavity above to close as rapidly as possible. In this way the trachea
is permanently terminated in the middle of the neck and patients
breathe through this opening. It has been found that with practice
they can retain sufficient air in the mouth and pharyngeal cavity to
permit them to whisper several words at a time. This simplifies the
procedure, and is now usually adopted after extirpation of the
larynx.
Partial laryngectomies have been practised through external
openings, one lateral half or more of the larynx being removed.
These operations have been few in number and often unsatisfactory.
They should be reserved for cases with favorable indications. When
required they are performed on the same principles as those already
outlined, only the extirpation is incomplete. Certain modifications
have been proposed by individuals, as, for instance, the suggestion
made by Gluck, to suture the opening in the trachea to a buttonhole
opening made in the overlying skin, by which means he thought to
prevent inspiration pneumonia.

OPERATIONS UPON THE TRACHEA.


Tracheotomy is the general term made to cover any opening into
the lower air passages between the larynx proper and the upper end
of the sternum. Laryngotomy, cricotracheotomy, tracheotomy, etc.,
may be described as implying by these names the exact location of
the opening. The principle is, however, the same, and the details of
the operation vary but little.
Fig. 482

Position of patient for tracheotomy. (Wharton.)

Tracheotomy as a deliberate operation is different from


tracheotomy as it was formerly practised for diphtheria, and as it is
yet done in emergencies, some cases being so serious that
suffocation will occur if the opening be not promptly afforded. In the
former case preparations can be made; in the latter, operation may
have to be done with the blade of a penknife. It makes considerable
difference also whether an anesthetic can be used. To administer
chloroform to a child with a heart already weakened by the toxins of
diphtheria is almost to invite disaster, and yet to do the operation
without an anesthetic is perhaps impossible.
The middle line is the line of safety in all of these operations. The
danger of heart failure from the anesthetic, or of suffocation from
tardiness of relief, being passed, the other principal danger is that of
hemorrhage. The isthmus of the thyroid may be divided, but always
with preliminary ligatures, or it should be caught between the blades
of pressure forceps on either side before dividing it. A patient with a
short, fat neck, whose cervical veins are dilated and engorged with
venous blood owing to partial asphyxia, makes a difficult and
undesirable subject. The trachea lies nearer the surface at its
laryngeal end than in its lower portion—i. e., if the operation be low
in the neck deep search will have to be made for the tube. The first
incision should be made sufficiently long, never less than two inches,
and should be so planned as to bring the operator down upon the
tracheal rings. By this time sufficient engorged veins may have been
divided to cause a serious oozing of dark, venous blood, by which
the field of vision is much obscured. Except in emergencies the
surgeon may wait for this engorgement to be relieved. The trachea,
being recognized by the finger-tip, is seized with a tenaculum, by
which it may be held forward, and then at least two of its rings
divided with the knife-blade. The instant the opening is made, if the
patient be still breathing, bloody foam and frothy blood will be
ejected, and for a moment or two the bleeding may be
uncontrollable. Under these circumstances the normal blood color
soon returns. Artificial respiration should be practised at the same
time. Supposing this to be an emergency case, with little or almost
nothing at hand, sutures should be passed through the tracheal
opening and through the skin margin on either side. If no other
retractor be at hand the suture materials may be left long and tied
behind the back of the neck, sufficient tension being made to
prevent the wound edges from coming together. Formerly when the
surgeon was called to do this operation with little or no help the
writer has extemporized a couple of retractors out of hair-pins, bent
for the purpose, hooked into the tracheal wound, then tied with
tapes, which were united behind the neck, while the wires were kept
from being pulled out of place by a skin suture on each side. There
is now less occasion for these crude methods since the introduction
of O’Dwyer’s intubation.
With tracheotomy done deliberately, and at the point of election,
usually above the thyroid isthmus, with or without division of the
cricoid, the vessels may be secured as they are exposed or bleed,
and the trachea should not be opened until all oozing from its
exterior has been checked. For this purpose the patient is placed
upon the back, the shoulders raised, the head thrown backward, and
the neck exposed, a pillow being placed beneath. (See Fig. 482.)
The operation may be done under cocaine local anesthesia or with a
general anesthetic. Incision in the middle line, below the lower
border of the thyroid cartilage, is made two inches or so downward,
the fascia beneath being divided in the same line and the tissues
retracted to either side from this median exposure. Thus one makes
access to the cricothyroid membrane, the cricoid, the upper tracheal
rings, and the thyroidal isthmus. According to the size and location
of the latter (it usually lies in front of the second tracheal ring) it
may be retracted or doubly ligated and divided in the middle. The
difficulty now afforded is from the upward and downward play of the
larynx, which may occur during forced efforts at respiration. To
steady it a tenaculum should be introduced just above the cricoid, a
little to one side of the middle line, firmly fastening it. With this held
in the left hand, thus steadying the parts, a sharp-pointed knife is so
employed as to divide the cricoid and one or two upper rings of the
trachea, being cautious not to wound the posterior wall. The
opening thus made should be about one-half inch in length. Through
it a second hook is now passed into the other side of the cricoid and
the incision held open by their agency while the trachea tube is
introduced.
This procedure may be modified in accordance with any local
indications, and may be made according to the needs of the case.
When the opening is made into the trachea below the isthmus it is
called a low tracheotomy. Here the anterior part of the trachea lies
free from the skin, but may be covered with a plexus of veins
connecting with the inferior thyroid. Farther down the arteria
thyroidea ima may be encountered. There is always reason for
operating as high as the case will permit. The trachea may itself be
displaced by the growth which compresses it and necessitates the
operation. Thus it may be crowded to one side, other anatomical
relations being disturbed, or it may be compressed into scabbard
shape, and thus be difficult to find or to open.
The moment the trachea is open more or less marked expulsive
efforts will drive blood and foam in all directions, and may for a
moment obscure the field of vision. Every precaution should be
taken to prevent the entrance of blood into the trachea. Pressure of
the tracheal walls against the tube to be inserted may check
hemorrhage from its margins. The operator should be ready to
suspend all other procedures and make artificial respiration, and he
should also be prepared to open the trachea suddenly, should
impending suffocation require it.
In a general way, then, the indications for tracheotomy are
symptoms of rapidly or slowly threatening obstruction to respiration
from causes either within the larynx—e. g., diphtheria, foreign
bodies, tumors, and the like—or causes external to it, such as
tumors, phlegmons, cicatrices, etc. Any cause which interferes with
the free play of air through the respiratory tube, which can be either
relieved or atoned for by the operation, will always justify it.
Tracheotomy tubes are mechanical devices for not only keeping
the tracheal wound open but permitting the unobstructed passage of
air. They are made of various materials, of which silver is the most
satisfactory, as aluminum is too easily acted upon by the fluids of the
body, and rubber occupies too much space. The tracheotomy tube is
a double tube, the inner one slipping easily into and out of the outer,
and being necessitated by the ease and abundance with which
secretions may collect and dry, and thus obstruct. Were it necessary
to remove the entire tube for each cleansing, difficulty might be met
in re-introducing it, whereas the inner tube is easily removed,
quickly cleansed, and restored to place within the outer without
disturbance or pain to the patient.
Aside from the tracheal tubes ordinarily used there are others
made exceptionally long, and with flexible lower ends, which may be
used in case of tumor low in the neck or high in the mediastinum—
for instance, in cases of enlarged thymus, where it is necessary to
go beyond an obstruction.
In the after-care of these cases it should be remembered that air
passes directly into the lung without being warmed, or moistened,
by passage over the mucous membrane of the upper respiratory
tract. The patient, therefore, should be kept in a warm room, and
the air should be kept moist by the use of a croup kettle or a spray
machine. The inner tube should be kept unobstructed, the length of
time during which it should remain depending on the nature of the
case. So soon as its usefulness is passed it should be removed. A
tracheotomy wound kept open but for a day or two will quickly close,
but one which has remained open for weeks may close with
difficulty, and then there may be trouble from granulation stenosis or
cicatricial contraction. (See above under Stricture.) In instances
where a permanent opening is to be maintained it is desirable to
remove the tube as early as circumstances may permit.

INTUBATION.
The perfection by Joseph O’Dwyer of a method, at which others
had worked, of substituting intubation of the larynx for the old
tracheotomy, not only shed the greatest luster upon his own name,
but has afforded a speedy and bloodless method of accomplishing
much more than had been previously possible by the older
procedure. The method comprises the emplacement of a suitably
sized and shaped tube within the larynx, by a manipulation guided
almost entirely by the sense of touch, for the relief of suffocative
symptoms due to disease at this level, and leaving the tube in situ
for a sufficient time to permit morbid activity to subside and justify
its removal.
It is advisable to have a half-dozen tubes, varying in size from
1¹⁄₂ inches to 2¹⁄₂ inches in length, and of corresponding increase
in other dimensions, each of which affords a passage-way for
respiratory purposes, and is also provided at its upper end with a
flange, which shall rest upon the false vocal cords and prevent the
descent of the tube into the trachea below. The complete set of
instruments as now furnished by all the manufacturers provides an
assortment of these tubes, with a scale indicating which one to use
upon a patient of a given age, and includes a mouth-gag, which may
be used for many purposes, and two handled instruments—one
intended for the introduction, the other for the extraction of the
metal tubes.
Fig. 483

O’Dwyer’s laryngeal tube and introducer.

Fig. 484

Mouth-gag.
Fig. 485

Extractor.
Fig. 486

Intubation of the larynx.


Fig. 487

The tube in the pharynx.

A suitable tube having been selected, a strong thread is passed


through a small opening near its head, thus affording means for
withdrawing it should there be need before it is finally left in its
resting place. The particular obturator meant for the tube to be used
is then firmly fastened upon the handle and over it the tube is
slipped. The instrument should then be tested to make sure that
disengagement of the tube will easily take place. Everything being
ready, the patient is then held in the arms and on the lap of an
assistant, in the position indicated in Fig. 486. The individual holding
the patient should be perfectly reliable in the matter of presence of
mind and self-control, for a great deal depends upon having a child
firmly and properly held during the moment of intubation. The arms
and hands of the patient should be well wrapped with a towel and
firmly held by the side of the chest, for the temptation is inevitable
to put the hand to the mouth and interfere with the operator. A
second assistant should stand above and behind, holding the mouth-
gag in position, as represented, and steadying it as well as the head.
It is necessary that the mouth-gag be held firmly in place, for if it
should become disengaged the child may bite the operator’s finger.

Fig. 488

The tube penetrates the larynx. (Lejars.)


Fig. 489

The stem is withdrawn while the finger fixes the tube. (Lejars.)

Standing in front of the patient the operator identifies the tip of


the epiglottis with the forefinger of the left hand in the pharynx, this
finger being used at the same time to raise and fix the epiglottis and
also to serve as a guide to the tip of the tube, which is passed
downward alongside it, by a maneuver similar to that by which the
laryngoscopic mirror is used in the pharynx (Fig. 487). When the tip
of the tube reaches the location behind the epiglottis the finger may
be passed a little farther downward, plugging the entrance to the
esophagus, while at the same time the handle of the instrument is
so manipulated as to bring the tube forward. With gentle movement
in the right direction it passes into the larynx (Fig. 488). It is then
pressed downward until the flanged upper end has passed the
epiglottis, after which the tube is disengaged, the handle and the
obturator withdrawn, and the upper end of the tube pressed gently
into place by the finger which still rests in the pharynx (Figs. 488,
489 and 490). During the manipulation there is almost complete
obstruction of the glottis for two or three seconds. The effort,
therefore, should be to shorten the procedure, and at no time should
it occupy more than two or three seconds. If the landmarks are not
easily recognized, and the tube is not placed at the expiration of
three seconds, the operator should discontinue for a few more
seconds in order that a few inspirations may be taken, after which
he should try again.
Fig. 490

The finger pushes the tube into place. (Lejars.)


Fig. 491

Withdrawal of the thread. (Lejars.)

When the tube is in place there will come ease of respiration, at


the same time violent coughing efforts, because of the irritation thus
suddenly produced. So soon as it is apparent, both to the finger in
the pharynx and from the relief of obstructive symptoms, that the
tube is in its proper place, the finger may be once more passed into
the pharynx, the tube pressed down, while the silk thread is
withdrawn, since it is not intended to leave it for more than the time
necessary to be assured that the tube will not have at once to come
out again (Fig. 491). Before removing the thread the gag should be
removed for a few moments, so that the effect of the excitement
may pass, after which it may be re-introduced for the purpose of
withdrawing the thread.
The procedure is by no means a simple nor necessarily easy one,
and it should be practised with the instruments upon the cadaver
before resorting to it on the living child.
The tube being placed it will remain to be decided by the
subsequent course of events how long it should be allowed to
remain—in some cases a few hours, in others a few days. With
young children it should remain for at least a week. The time having
arrived for its removal, the procedure is similar to that required for
its introduction. The assistants hold the child in the same position as
before, while the operator substitutes the extractor, guiding its tip
again by the sense of touch along the left index finger, which,
passed down into the pharynx, is made to discover and identify the
upper end of the metallic tube. So soon as the point of the extractor
is engaged within the tube the blades are separated and it is then
drawn out, while the finger is withdrawn along with it in order to
make its removal easier and to prevent its loss should it slip off the
instrument. Unless the patient struggles violently the whole
procedure should be conducted so as to scarcely cause the slightest
staining of the expectoration with blood.
Various causes may require abrupt removal of the tube. Thus it is
possible for its caliber to be become occluded with tenacious
secretion. This may produce a violent fit of coughing, during which
there may occur spontaneous expulsion of the tube. At any time,
when it is seen that asphyxia is increasing, or when violence of
respiratory effort would indicate obstruction within the tube, it
should be removed, cleaned, and re-introduced. After its introduction
and removal the operator should remain within easy reach for a
short time, to be sure that no unpleasant effects result and that no
re-introduction may be suddenly required. Should obstructive efforts
occur the child should be held head downward and be slapped
vigorously upon the chest. This may loosen membrane or it may
permit dislodgement of the tube and its spontaneous expulsion. The
latter may also occur during the act of vomiting.
The above description is meant especially to apply to intubation as
performed upon young children for the relief of the laryngeal
obstruction consequent upon diphtheria. It has given better results
than tracheotomy, which was the only resort previous to O’Dwyer’s
device. It is usually performed easily, and is devoid of the horrors
frequently attendant upon an emergency tracheotomy. But
intubation is not necessarily limited to children nor to cases of
diphtheria. The emplacement of such a tube may be called for at
any time in cases of threatening or actual edema of the glottis, as,
for instance, from inhalation of steam or flame. It may be advisable
in other forms of intralaryngeal disease, both acute and chronic,
while individuals suffering from laryngeal stricture or stenosis find
that they can wear an O’Dwyer tube almost constantly, not only with
relief, but that they are thereby saved from the more serious
measure of opening the trachea or removing the larynx.
Impending suffocation having been relieved by intubation, the
question of feeding arises. The principal disadvantage attendant
upon the use of the tube is partial or complete inability to swallow,
for the epiglottis does not always easily close over the tube and
prevent entrance of fluid into the larynx. It is necessary to feed
patients, especially the young, with extreme care. For this purpose
there is no food better than ice-cream, while little children should be
placed upon their backs, with the head lower than the body, and
made to swallow in this position, at least until they have been
accustomed to the presence of the tube and instinctively learn how
to avoid irritation by involuntary regulation of the act of swallowing.
CHAPTER XLII.
THE NECK.

CONGENITAL ANOMALIES OF THE NECK.


These consist largely of defects due to arrest of development
along the lines of the branchial clefts. Necessarily of embryonic
origin, they do not reveal this until varying periods after birth,
sometimes not until old age. They consist of fistulas, opening either
externally or internally, or more commonly of cystic dilatations of the
interior portions of the original fissures. External openings are
usually seen along the sternomastoid, either in front or back of it, or
between the larynx and the clavicle. Vestiges are also present in the
shape of little tags of skin containing portions of cartilage or bone.
They frequently occur together, the tag indicating the location of the
fistula, whose opening may be found obstructed with crusts.
Internally the openings are usually found in the pharynx, perhaps in
the larynx or trachea, generally near the tonsil and base of the
tongue. An external fistula may be tested for its completeness by
injecting a colored fluid and inspecting the pharynx. The fistulous
portion is usually marked by a cord-like mass which extends inward,
usually toward the hyoid bone. Internal blind fistulas may gradually
expand and constitute one variety of the so-called pulsion diverticula
of the pharynx and upper esophagus, their dilatation being due to
accumulation of food, and gradual stretching in this way.
All of these embryonic relics are of interest because from their
small beginnings large growths may take place, constituting even
serious surgical problems. These growths may present in almost any
region of the neck and frequently extend into the mouth, where they
give rise to certain forms of ranula. Almost every cystic tumor
beneath the tongue or jaw is open to the suspicion of having an
embryonic origin. Most of these vestiges are amenable to surgical
treatment should they give rise to discomfort or trouble. The
operations required are sometimes quite extensive, as any tumors of
branchiogenic origin are especially liable to adhesions to the large
vessels; moreover, they are nearly always firm and the dissection
thus made difficult. A dermoid cyst may be evacuated and its wall or
sac destroyed or dissected out. It may then be made to heal by
packing.
Treatment.—In the treatment of fistulas of the neck, König has
advised that a curved probe be passed through the tract to a point
close to the tonsil, at which point on the inside of the mouth or
pharynx the mucous membrane is incised, a silk thread is fastened
to the end of the probe, pulled out with it, then made to pass to the
external end of the fistulous tube, which is then invaginated and
pulled back into the mouth, where it is reduced to a short stump
which is fastened to the margins of the opening of the mucous
membrane. The external wound is then made to heal as usual. This
treatment suffices for blind internal fistulas of the cervical region.
It is a matter of great surgical importance and interest that certain
branchiogenic remnants persist in a perfectly harmless manner until
advanced life is reached, after which there take place therein
cancerous changes which convert them into the so-called cancers of
branchiogenic origin. These are too often of hopeless character by
the time they are seen by the surgeon.
Other congenital defects consist of atrophies, such, for instance,
atrophy of the sternomastoid muscle, or of certain hypertrophies
which may be unilateral or symmetrical.

WOUNDS AND INJURIES OF THE NECK.


The neck is everywhere exposed to incised and perforating
wounds, partly as the result of pure accident, too often as the result
of homicidal efforts. The most exposed parts are supplied with veins
of large caliber which connect directly with the heart, and whatever
danger there may be of entrance of air into the veins, under any
circumstances, is in this region enhanced. This entrance of air has
been regarded as a serious and often fatal accident. The writer’s
experience and research have shown that it may often occur in mild
degree with but little temporary disturbance. Should it occur the fact
will be indicated by a slight gurgling sound, with tumultuous action
of the heart, dilatation of the pupils, embarrassed breathing, and
every indication of lowered blood pressure. Every competent
operator will secure these large veins before dividing them, but if
anything of this kind should be noted during an operation, pressure
or plugging of the wound, with artificial respiration, perhaps even
massage of the heart, and tracheotomy if necessary, should be
practised until the patient has revived. If in the course of an
exceedingly deep dissection the accident can be foreseen it may be
avoided by keeping the wound filled with warm sterilized salt
solution. This, however, will seriously embarrass the operative work,
as it obscures vision.
The lower in the neck a serious wound be received, other things
being equal, the more dangerous it becomes. Thus penetrating
wounds above the larynx are of less importance than those below it.
All injuries or wounds about the larynx are not only likely to dislodge
its interior cartilages, but are especially likely to be followed by
pressure of effused blood, or the consequences of a rapid edema of
the glottis, which may prove fatal unless the trachea be opened
below. It is this fact which makes fracture of the larynx so dangerous
an injury.
A wound of the trachea rarely occurs by itself, as it lies deeply,
and it may be especially serious if vessels in this neighborhood have
been so injured that blood may be easily poured or escape into the
lungs. If the trachea be completely divided its ends will be separated
and gap, while the lower end will be drawn out with each deep
inspiration. In this way suffocation may quickly occur. In all such
cases the head should be placed lower than the body (Rose’s
position), the lungs emptied completely, the wound enlarged, and
the tracheal wound be sutured or else a tube be inserted. The
treatment must largely depend upon the number of hours which
have elapsed since its infliction, and the condition of the wound
itself. In these cases it may be assumed that such a wound is
infected, therefore it should not be closed without provision for
drainage.
Any injury to the respiratory tract proper will be indicated by the
character of the expectoration and the sounds heard on
auscultation. Such injuries are likely to be complicated by a
subsequent bronchitis, pneumonia, deep abscess, or various other
undesirable sequences. Under the suggestive term “Schluck-
pneumonie” the Germans have described a condition which we
describe in the term “inhalation pneumonia.” It implies a septic type
of pneumonia caused by the passage downward of foreign material,
including septic wound secretions, which, not being expelled
promptly, cause a type of inflammation, with consolidation, which
will give most of the ordinary physical signs of pneumonia.
A rather distinct type of incised wound is that included in the term
“cut-throat.” It implies a homicidal, usually suicidal, attempt on the
part of the ignorant to sever the large vessels in the neck. This is but
rarely accomplished, the injury being done to the larynx and the
trachea and the tissues anterior to the vascular trunks. Usually
inflicted with the right hand, one side of the wound may be deeper
than the other. While the trachea is usually cut and often divided,
the injury may be to the larynx instead. At all events, a wide gash is
made and there is considerable hemorrhage, the external jugulars
being nearly always severed. By the time such a wound is seen by
the surgeon it is an infected wound and it should not be closed too
tightly. The trachea may be sutured by itself, but it will be best to
place therein a tracheal tube. Ample provision should also be made
for drainage. In some instances the wound may be left open, at
least for a few days, until it is granulating, and then be closed by
deep sutures. Care should always be given to those of desperate
suicidal intent and to the maniacal, that they do not reopen the
wound in continuation of their previous efforts. This requires careful
watching.
Rupture of the trachea, either due to violent coughing or straining
efforts or to external violence, is known. It will call for tracheotomy,
because of the emphysema which will ensue. Penetrating wounds of
the large arteries and veins are always serious. When not extensive
they may be followed by diffuse or circumscribed hematoma or by
aneurysm. Nélaton is reported to have stated that it takes four
minutes for a man to bleed to death from the carotid artery, and that
two minutes should suffice for its ligation. Any injury to the vessels
should be followed by their exposure, and probably by ligation or
suture, in order to prevent the conditions above mentioned. If the
wound be low in the neck it would be proper to remove the upper
end of the sternum or to divide the sternomastoid sufficiently to
expose it.
The vertebral artery is occasionally injured, mostly in the osseous
canal through which it passes. At the base of the neck a wound at or
near its origin is an exceedingly serious injury. The same rules apply
as above.
Wounds of the large veins are supposed to be of a more serious
nature because of the possibility of inspiration of air, i. e., air
embolism. These vessels are occasionally injured during removal of
deep-seated and adherent tumors. It has been possible in some
instances to make a lateral suture of the jugular vein at the point of
injury, providing this be not too extensive. Effort at reunion of this
kind is always legitimate if the operator feel himself equal to the
task. The jugular vein is also occasionally exposed and tied low
down, then opened above the ligature, for the purpose of cleaning
out its upper portion when filled with infective thrombi, a condition
occasionally seen with mastoid abscess, etc. To open it before tying
would be a surgical mistake. By this process it is practically
obliterated as recovery ensues.
If such a muscle as the sternomastoid be partially or completely
divided muscle suture should be practised and the head and neck
kept at rest for the ensuing few days.
Injuries to the cervical nerves may be followed by peculiar and
interesting features. That of the recurrent laryngeal will cause
paralysis of the laryngeal muscles on one side, with consequent
difficulty in speech; injury to the cervical sympathetic will be
followed by dilatation of the pupils and protrusion of the eyeballs
with flushing; of the spinal accessory, by mastoid and trapezius
paralysis; of the phrenic, by paralysis of the diaphragm on one side;
and of the pneumogastric, by embarrassment of respiration, with
pupillary and abdominal symptoms, which are variable. Of all of
these injuries that to the phrenic is probably the most serious. Some
years ago I tabulated the then recorded cases of injury to the
pneumogastric and was able to show that only about 50 per cent. of
such cases were immediately or tardily fatal. The phrenic nerve is
then the only one within the neck which can scarcely be spared. Any
of these nerves when divided should be reunited by sutures, as
elsewhere described.
When any portion of the brachial plexus has been injured a
corresponding paralysis of the arm will follow. Wounds of these
nerves should be sutured at once. A distinction should be made in all
cases between hysterical anesthesia, malingering, and the actual
paralysis of injury. Sometimes the amount of callus thrown out after
a fracture of the clavicle will include a nerve of sufficient size to
produce a neurosis, usually neuralgia, or possibly a paralysis.
Excessive callus, or, in effect, the bony tumor which is thus
produced, may be removed by operation, and any entangled nerve
should be hunted out and liberated.
Pressure of a tumor upon a nerve will cause paralysis
corresponding to its degree. When this comes on gradually, even
though it involve the phrenic nerve, the consequences are not so
serious. Repeated irritation or pressure may cause paralysis, as in
the cases of the strap of letter-carriers or those who carry burdens
slung from the neck.
Injuries occur to the cervical muscles during parturition and a
hematoma of the sternomastoid in the newborn is described. The
muscle is contracted and the head bent over. It usually disappears
by resolution within a short time. This muscle is also ruptured by
violence in the adult; again, hematoma is the result, with at least
temporary torticollis, pain, and tenderness. When an abrupt division
can be recognized, exposure of the ends and muscle suture would
be indicated. At any time, in the presence of clot, it would be proper
to cut down and turn it out.
Syphilitic myositis is often seen in the sternomastoid, where it may
affect the entire muscle, transforming it into a cord-like mass, or
where it may occur as gummatous infiltration. These cases occur
without pain and without known cause save the disease itself, whose
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!

textbookfull.com

You might also like