100% found this document useful (2 votes)
34 views

A Common Sense Guide to Data Structures and Algorithms in Python Volume 1 Level Up Your Core Programming Skills Jay Wengrow - Own the complete ebook with all chapters in PDF format

The document promotes the ebook 'A Common Sense Guide to Data Structures and Algorithms in Python Volume 1' by Jay Wengrow, available for download at ebookfinal.com. It includes links to additional recommended ebooks on related topics, emphasizing the importance of understanding data structures and algorithms for efficient programming. The book aims to simplify complex concepts using common-sense language and practical examples, making it accessible for readers with varying levels of expertise.

Uploaded by

asesrausch
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
34 views

A Common Sense Guide to Data Structures and Algorithms in Python Volume 1 Level Up Your Core Programming Skills Jay Wengrow - Own the complete ebook with all chapters in PDF format

The document promotes the ebook 'A Common Sense Guide to Data Structures and Algorithms in Python Volume 1' by Jay Wengrow, available for download at ebookfinal.com. It includes links to additional recommended ebooks on related topics, emphasizing the importance of understanding data structures and algorithms for efficient programming. The book aims to simplify complex concepts using common-sense language and practical examples, making it accessible for readers with varying levels of expertise.

Uploaded by

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

Visit ebookfinal.

com to download the full version and


explore more ebooks or textbooks

A Common Sense Guide to Data Structures and


Algorithms in Python Volume 1 Level Up Your Core
Programming Skills Jay Wengrow

_____ Click the link below to download _____


https://ebookfinal.com/download/a-common-sense-guide-to-
data-structures-and-algorithms-in-python-volume-1-level-up-
your-core-programming-skills-jay-wengrow/

Explore and download more ebooks or textbook at ebookfinal.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Problem Solving in Data Structures Algorithms Using Python


Programming Interview Guide 1st Edition Hemant Jain

https://ebookfinal.com/download/problem-solving-in-data-structures-
algorithms-using-python-programming-interview-guide-1st-edition-
hemant-jain/

Data structures and algorithms in Java 2nd Edition Adam


Drozdek

https://ebookfinal.com/download/data-structures-and-algorithms-in-
java-2nd-edition-adam-drozdek/

Algorithms and Theory of Computation Handbook Second


Edition Volume 1 General Concepts and Techniques Chapman
Hall CRC Applied Algorithms and Data Structures series
Mikhail J. Atallah
https://ebookfinal.com/download/algorithms-and-theory-of-computation-
handbook-second-edition-volume-1-general-concepts-and-techniques-
chapman-hall-crc-applied-algorithms-and-data-structures-series-
mikhail-j-atallah/

Lining Up Data in ArcGIS A Guide to Map Projections 2nd


Edition Maher

https://ebookfinal.com/download/lining-up-data-in-arcgis-a-guide-to-
map-projections-2nd-edition-maher/
Five Dimensions of Quality A Common Sense Guide to
Accreditation and Accountability 1st Edition Linda Suskie

https://ebookfinal.com/download/five-dimensions-of-quality-a-common-
sense-guide-to-accreditation-and-accountability-1st-edition-linda-
suskie/

Introduction to Computation and Programming Using Python


with Application to Understanding Data 2nd edition Edition
Guttag
https://ebookfinal.com/download/introduction-to-computation-and-
programming-using-python-with-application-to-understanding-data-2nd-
edition-edition-guttag/

Head First Programming A Learner s Guide to Programming


Using the Python Language 1st Edition David Griffiths

https://ebookfinal.com/download/head-first-programming-a-learner-s-
guide-to-programming-using-the-python-language-1st-edition-david-
griffiths/

Common Core Curriculum English Grades 9 12 2nd Edition


Common Core

https://ebookfinal.com/download/common-core-curriculum-english-
grades-9-12-2nd-edition-common-core/

Fundamentals of Python From First Programs through Data


Structures 1st Edition Kenneth A. Lambert

https://ebookfinal.com/download/fundamentals-of-python-from-first-
programs-through-data-structures-1st-edition-kenneth-a-lambert/
A Common Sense Guide to Data Structures and
Algorithms in Python Volume 1 Level Up Your Core
Programming Skills Jay Wengrow Digital Instant
Download
Author(s): Jay Wengrow
ISBN(s): 9798888650356, 8888650350
Edition: P1.0
File Details: PDF, 17.44 MB
Year: 2023
Language: english
A Common-Sense
Guide to Data
Structures and
Algorithms in
Python, Volume 1
Level Up Your Core Programming
Skills

by Jay Wengrow

Version: P1.0 (December 2023)


Copyright © 2023 The Pragmatic Programmers, LLC. This book is licensed to the
individual who purchased it. We don't copy-protect it because that would limit your
ability to use it for your own purposes. Please don't break this trust—you can use
this across all of your devices but please do not share this copy with other
members of your team, with friends, or via file sharing services. Thanks.

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 Pragmatic Programmers, LLC was aware of a trademark claim, the
designations have been printed in initial capital letters or in all capitals. The
Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming,
Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic
Programmers, LLC.

Every precaution was taken in the preparation of this book. However, the publisher
assumes no responsibility for errors or omissions, or for damages that may result
from the use of information (including program listings) contained herein.

About the Pragmatic Bookshelf


The Pragmatic Bookshelf is an agile publishing company. We’re here because we
want to improve the lives of developers. We do this by creating timely, practical
titles, written by programmers for programmers.

Our Pragmatic courses, workshops, and other products can help you and your
team create better software and have more fun. For more information, as well as
the latest Pragmatic titles, please visit us at http://pragprog.com.

Our ebooks do not contain any Digital Restrictions Management, and have always
been DRM-free. We pioneered the beta book concept, where you can purchase and
read a book while it’s still being written, and provide feedback to the author to
help make a better book for everyone. Free resources for all purchasers include
source code downloads (if applicable), errata and discussion forums, all available
on the book's home page at pragprog.com. We’re here to make your life easier.

New Book Announcements


Want to keep up on our latest titles and announcements, and occasional special
offers? Just create an account on pragprog.com (an email address and a password
is all it takes) and select the checkbox to receive newsletters. You can also follow
us on twitter as @pragprog.

About Ebook Formats


If you buy directly from pragprog.com, you get ebooks in all available formats for
one price. You can synch your ebooks amongst all your devices (including
iPhone/iPad, Android, laptops, etc.) via Dropbox. You get free updates for the life of
the edition. And, of course, you can always come back and re-download your books
when needed. Ebooks bought from the Amazon Kindle store are subject to
Amazon's polices. Limitations in Amazon's file format may cause ebooks to display
differently on different devices. For more information, please see our FAQ at
pragprog.com/#about-ebooks. To learn more about this book and access the free
resources, go to https://pragprog.com/book/jwpython, the book's homepage.

Thanks for your continued support,

The Pragmatic Bookshelf

The team that produced this book includes: Dave Thomas (Publisher),
Janet Furlow (COO), Tammy Coron (Managing Editor),
Katharine Dvorak (Development Editor), L. Sakhi MacMillan (Copy Editor),
Potomac Indexing, LLC (Indexing), Gilson Graphics (Layout)

For customer support, please contact [email protected].

For international rights, please contact [email protected].


Table of Contents

Preface
Who Is This Book For?
The Python Edition
A Note About the Code
What’s in This Book?
How to Read This Book
Online Resources
Connecting

Acknowledgments

1. Why Data Structures Matter


Data Structures
The Array: The Foundational Data Structure
Measuring Speed
Reading
Searching
Insertion
Deletion
Sets: How a Single Rule Can Affect Efficiency
Wrapping Up
Exercises
2. Why Algorithms Matter
Ordered Arrays
Searching an Ordered Array
Binary Search
Binary Search vs. Linear Search
Wrapping Up
Exercises

3. O Yes! Big O Notation


Big O: How Many Steps Relative to N Elements?
The Soul of Big O
An Algorithm of the Third Kind
Logarithms
O(log N) Explained
Practical Examples
Wrapping Up
Exercises

4. Speeding Up Your Code with Big O


Bubble Sort
Bubble Sort in Action
The Efficiency of Bubble Sort
A Quadratic Problem
A Linear Solution
Wrapping Up
Exercises
5. Optimizing Code With and Without Big O
Selection Sort
Selection Sort in Action
The Efficiency of Selection Sort
Ignoring Constants
Big O Categories
Wrapping Up
Exercises

6. Optimizing for Optimistic Scenarios


Insertion Sort
Insertion Sort in Action
The Efficiency of Insertion Sort
The Average Case
A Practical Example
Wrapping Up
Exercises

7. Big O in Everyday Code


Mean Average of Even Numbers
Word Builder
Array Sample
Average Celsius Reading
Clothing Labels
Count the Ones
Palindrome Checker
Get All the Products
Password Cracker
Wrapping Up
Exercises

8. Blazing Fast Lookup with Hash Tables


Hash Tables
Hashing with Hash Functions
Building a Thesaurus for Fun and Profit, but Mainly
Profit
Hash Table Lookups
Dealing with Collisions
Making an Efficient Hash Table
Hash Tables for Organization
Hash Tables for Speed
Wrapping Up
Exercises

9. Crafting Elegant Code with Stacks and


Queues
Stacks
Abstract Data Types
Stacks in Action
The Importance of Constrained Data Structures
Queues
Queues in Action
Wrapping Up
Exercises
10. Recursively Recurse with Recursion
Recurse Instead of Loop
The Base Case
Reading Recursive Code
Recursion in the Eyes of the Computer
Filesystem Traversal
Wrapping Up
Exercises

11. Learning to Write in Recursive


Recursive Category: Repeatedly Execute
Recursive Category: Calculations
Top-Down Recursion: A New Way of Thinking
The Staircase Problem
Anagram Generation
Wrapping Up
Exercises

12. Dynamic Programming


Unnecessary Recursive Calls
The Little Fix for Big O
The Efficiency of Recursion
Overlapping Subproblems
Dynamic Programming Through Memoization
Dynamic Programming Through Going Bottom-Up
Wrapping Up
Exercises
13. Recursive Algorithms for Speed
Partitioning
Quicksort
The Efficiency of Quicksort
Quicksort in the Worst-Case Scenario
Quickselect
Sorting as a Key to Other Algorithms
Wrapping Up
Exercises

14. Node-Based Data Structures


Linked Lists
Implementing a Linked List
Reading
Searching
Insertion
Deletion
Efficiency of Linked List Operations
Linked Lists in Action
Doubly Linked Lists
Queues as Doubly Linked Lists
Wrapping Up
Exercises

15. Speeding Up All the Things with Binary


Search Trees
Trees
Binary Search Trees
Searching
Insertion
Deletion
Binary Search Trees in Action
Binary Search Tree Traversal
Wrapping Up
Exercises

16. Keeping Your Priorities Straight with Heaps


Priority Queues
Heaps
Heap Properties
Heap Insertion
Looking for the Last Node
Heap Deletion
Heaps vs. Ordered Arrays
The Problem of the Last Node…Again
Arrays as Heaps
Heaps as Priority Queues
Wrapping Up
Exercises

17. It Doesn’t Hurt to Trie


Tries
Storing Words
Trie Search
The Efficiency of Trie Search
Trie Insertion
Building Autocomplete
Completing Autocomplete
Tries with Values: A Better Autocomplete
Wrapping Up
Exercises

18. Connecting Everything with Graphs


Graphs
Directed Graphs
Object-Oriented Graph Implementation
Graph Search
Depth-First Search
Breadth-First Search
The Efficiency of Graph Search
Weighted Graphs
Dijkstra’s Algorithm
Wrapping Up
Exercises

19. Dealing with Space Constraints


Big O of Space Complexity
Trade-Offs Between Time and Space
The Hidden Cost of Recursion
Wrapping Up
Exercises
20. Techniques for Code Optimization
Prerequisite: Determine Your Current Big O
Start Here: The Best-Imaginable Big O
Magical Lookups
Recognizing Patterns
Greedy Algorithms
Change the Data Structure
Wrapping Up
Parting Thoughts
Exercises

A1. Exercise Solutions


Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
Chapter 15
Chapter 16
Chapter 17
Chapter 18
Chapter 19
Chapter 20

Copyright © 2024, The Pragmatic Bookshelf.


Early Praise for A
Common-Sense Guide to
Data Structures and
Algorithms in Python,
Volume 1
Students and programmers everywhere are told how
important algorithms and data structures are for
creating quality software—not to mention getting hired
at the best companies—and, yet, there are so few
resources that bring actual clarity to the topic. This book
does! The combination of Python’s simplicity and Jay’s
ability to drill down on what you need to know is a
winning formula. Reading this book is a worthwhile
investment for any software engineer.

→ Lyndon Purcell
Software Developer, OK200
A Common Sense Guide to Data Structures and
Algorithms in Python is one of those rare books that
both unravels the sometimes impenetrable algorithmic
content and keeps the reader engaged with a direct and
approachable writing style. I highly recommend this
book to anyone that wants to dig into algorithms to
improve their programming skills.

→ Terry Peppers
Vice President of Engineering, LogicGate
As a beginner to coding, I have read many books on
algorithms and Jay’s book is the only one which doesn’t
assume the reader is a math genius nor does it treat
you in a condescending manner. From the start of the
book he encourages your learning and understanding as
a mentor and a friend.

→ Katy Douglas
Student, The Open University
The book serves as an exceptional reference for
individuals seeking to grasp the fundamental concepts
in data structures and algorithms (DSA) and an ideal
entry point to the realm of DSA, particularly for those
with limited or no prior background in computer science.
It excels in explaining the complex algorithms by using
clever illustrations and examples, making the book a
fascinating read.

→ Ahmad Shahba
Lead Software Engineer, Science Systems and
Applications, Inc.
The easy-to-digest and approachable content makes the
rather obtuse and math-heavy jargon field of data
structures and algorithms quite approachable to all. If
you don’t like switching contexts whilst studying, this
special edition is for you, as it uses only Python to
demonstrate concepts. You can’t go wrong with this
book!

→ Paa JAKE
Software and Test Engineer
Preface
Data structures and algorithms are more than abstract
concepts. Mastering them enables you to write code that is
efficient, leading to software that runs faster and consumes
less memory. This is a big deal for today’s software
applications, which exist on increasingly mobile platforms
and handle increasingly greater amounts of data.

The problem with most resources on these subjects, though,


is that they are...well...obtuse. Most texts go heavy on the
math jargon, and if you’re not a mathematician, it can be
difficult to grasp what on earth is going on. Even books that
claim to make algorithms “easy” seem to assume that the
reader has an advanced math degree. Because of this, too
many people shy away from these concepts feeling that
they’re not “smart” enough to understand them.

The truth, though, is that everything about data structures


and algorithms boils down to common sense. Mathematical
notation itself is simply a particular language, and
everything in math can also be explained with common-
sense terminology. In this book, I use that common-sense
language (plus a lot of diagrams!) to explain these concepts
in simple and, dare I say, enjoyable ways.
Once you understand these concepts, you’ll be equipped to
write code that is efficient, fast, and elegant. You’ll be able
to weigh the pros and cons of various code alternatives and
be able to make educated decisions as to which code is best
for the given situation.

In this book, I go out of my way to make these concepts real


and practical with ideas that you can make use of today.
Sure, you’ll learn some really cool computer science along
the way. But this book is about taking that seemingly
abstract stuff and making it directly practical. You’ll be
writing better code and faster software by the time you’re
done reading this book.
Who Is This Book For?
This book is ideal for several audiences:

You’re a computer science student who wants a text


that explains data structures and algorithms in plain
English. This book can serve as a supplement to
whatever “classic” textbook you happen to be using.

You’re a beginning developer who knows basic


programming but wants to learn the fundamentals of
computer science to write better code and increase your
programming knowledge and skills.

You’re a self-taught developer who has never studied


formal computer science (or a developer who did but
forgot everything!) and wants to leverage the power of
data structures and algorithms to write more scalable
and elegant code.

Whoever you may be, I tried to write this book so that it can
be accessed and enjoyed by people of all skill levels.
The Python Edition
Pythonistas, rejoice! All the code in this book is written in
Python. The original edition of this book, A Common-Sense
Guide to Data Structures and Algorithms (the second edition
of which was published in 2020), was language-agnostic; it
was written using multiple programming languages. The
idea behind this was that we didn’t want to imply that the
book would only be helpful for one language, given that
data structures and algorithms are concepts that apply
across all of computing in general.

Over the years, I received feedback from readers who


expressed that they would love to see language-specific
editions of the book. After all, if you’re working with one
particular programming language, wouldn’t it be nice to
have a book in which all of the code is in that language?

Accordingly, I set out to create new single-language


versions of A Common-Sense Guide to Data Structures and
Algorithms. The first of these is the Python version and is
what you’re reading now! And because there’s so much to
say about data structures and algorithms, this is the first
volume in a progression of books. In this volume, I lay the
foundation for these concepts and cover the most common
data structures and algorithms. In the next volume, I’ll build
upon this knowledge to level up further with more advanced
ideas and techniques.
Discovering Diverse Content Through
Random Scribd Documents
Fig. 313.—Diodon maculatus.

Fig. 314.—Diodon maculatus, inflated.


C. Molina.—Body compressed, very short; tail extremely short,
truncate. Vertical fins confluent. No pelvic bone.
The “Sun-fishes” (Orthagoriscus) are pelagic fishes, found in
every part of the oceans within the tropical and temperate zones.
The singular shape of their body and the remarkable changes which
they undergo with age, have been noticed above (p. 175, Figs. 93,
94). Their jaws are undivided in the middle, comparatively feeble, but
well adapted for masticating their food, which consists of small
pelagic Crustaceans. Two species are known. The common Sun-
fish, O. mola, which attains to a very large size, measuring seven or
eight feet, and weighing as many hundredweights. It has a rough,
minutely granulated skin. It frequently approaches the southern
coasts of England and the coasts of Ireland, and is seen basking in
calm weather on the surface. The second species, O. truncatus, is
distinguished by its smooth, tessellated skin, and one of the scarcest
fishes in collections. The shortness of the vertebral column of the
Sun-fishes, in which the number of caudal vertebra is reduced to
seven, the total number being seventeen, and the still more reduced
length of the spinal chord have been noticed above (p. 96).

THIRD SUB-CLASS—CYCLOSTOMATA.
Skeleton cartilaginous and notochordal, without ribs and without
real jaws. Skull not separate from the vertebral column. No limbs.
Gills in the form of fixed sacs, without branchial arches, six or seven
in number on each side. One nasal aperture only. Heart without
bulbus arteriosus. Mouth anterior, surrounded by a circular or
subcircular lip, suctorial. Alimentary canal straight, simple, without
coecal appendages, pancreas or spleen. Generative outlet
peritoneal. Vertical fins rayed.
The Cyclostomes are most probably a very ancient type.
Unfortunately the organs of these creatures are too soft to be
preserved, with the exception of the horny denticles with which the
mouth of some of them is armed. And, indeed, dental plates, which
are very similar to those of Myxine, are not uncommon in certain
strata of Devonian and Silurian age (see p. 193). The fishes
belonging to this sub-class may be divided into two families—

First Family—Petromyzontidæ.
Body eel-shaped, naked. Subject to a metamorphosis; in the
perfect stage with a suctorial mouth armed with teeth, simple or
multicuspid, horny, sitting on a soft papilla. Maxillary, mandibulary,
lingual, and suctorial teeth may be distinguished. Eyes present (in
mature animals). External nasal aperture in the middle of the upper
side of the head. The nasal duct terminates without perforating the
palate. Seven branchial sacs and apertures on each side behind the
head; the inner branchial ducts terminate in a separate common
tube. Intestine with a spiral valve. Eggs small. The larvæ without
teeth, and with a single continuous vertical fin.
“Lampreys” are found in the rivers and on the coasts of the
temperate regions of the northern and southern hemispheres. Their
habits are but incompletely known, but so much is certain that at
least some of them ascend rivers periodically, for the purpose of
spawning, and that the young pass several years in rivers, whilst
they undergo a metamorphosis (see p. 170). They feed on other
fishes, to which they suck themselves fast, scraping off the flesh with
their teeth. Whilst thus engaged they are carried about by their
victim; Salmon have been captured in the middle course of the Rhine
with the Marine Lamprey attached to them.

Fig. 315.—Mouth of Larva of


Petromyzon branchialis.
Fig. 316.—Mouth of Petromyzon
fluviatilis. mx, Maxillary tooth; md,
Mandibulary tooth; l, Lingual tooth;
s, Suctorial teeth.
Petromyzon.—Dorsal fins two, the posterior continuous with the
caudal. The maxillary dentition consists of two teeth placed close
together, or of a transverse bicuspid ridge; lingual teeth serrated.

The Lampreys belonging to this genus are found in the northern


hemisphere only; the British species are the Sea-Lamprey (P.
marinus), exceeding a length of three feet, and not uncommon on
the European and North American coasts; the River-Lamprey or
Lampern (P. fluviatilis), ascending in large numbers the rivers of
Europe, North America, and Japan, and scarcely attaining a length
of two feet; the “Pride” or “Sand-Piper” or Small Lampern (P.
branchialis), scarcely twelve inches long, the larva of which has been
long known under the name of Ammocoetes.
Ichthyomyzon from the western coasts of North America is said
to have a tricuspid maxillary tooth.
Mordacia.—Dorsal fins two, the posterior continuous with the
caudal. The maxillary dentition consists of two triangular groups, each
with three conical acute cusps; two pairs of serrated lingual teeth.
Fig. 317.—Mouth of Mordacia mordax, closed and
opened.
A Lamprey (M. mordax) from the coasts of Chile and Tasmania.
This fish seems to be provided sometimes with a gular sac, like the
following.[47]

Fig. 318.—Mordacia mordax.


Geotria.—Dorsal fins two, the posterior separate from the caudal.
Maxillary lamina with four sharp flat lobes; a pair of long pointed
lingual teeth.
Two species, one from Chile and one from South Australia. They
grow to a length of two feet, and in some specimens the skin of the
throat is much expanded, forming a large pouch. Its physiological
function is not known. The cavity is in the subcutaneous cellular
tissue, and does not communicate with the buccal or branchial
cavities. Probably it is developed with age, and absent in young
individuals. In all the localities in which these Extra-european
Lampreys are found, Ammocoetes forms occur, so that there is little
doubt that they undergo a similar metamorphosis as P. branchialis.
Second Family—myxinidæ.
Body eel-shaped, naked. The single nasal aperture is above the
mouth, quite at the extremity of the head, which is provided with four
pairs of barbels. Mouth without lips. Nasal duct without cartilaginous
rings, penetrating the palate. One median tooth on the palate, and
two comb-like series of teeth on the tongue (see Fig. 101). Branchial
apertures at a great distance from the head; the inner branchial
ducts lead into the œsophagus. A series of mucous sacs along each
side of the abdomen. Intestine without spiral valve. Eggs large, with
a horny case provided with threads for adhesion.

Fig. 319.—Ovum of Myxine


glutinosa, enlarged.
The fishes of this family are known by the names of “Hag-Fish,”
“Glutinous Hag,” or “Borer;” they are marine fishes with a similar
distribution as the Gadidæ, being most plentiful in the higher
latitudes of the temperate zones of the northern and southern
hemispheres. They are frequently found buried in the abdominal
cavity of other fishes, especially Gadoids, into which they penetrate
to feed on their flesh. They secrete a thick glutinous slime in
incredible quantities, and are therefore considered by fishermen a
great nuisance, seriously damaging the fisheries and interfering with
the fishing in localities where they abound. Myxine descends to a
depth of 345 fathoms, and is generally met with in the Norwegian
Fjords at 70 fathoms, sometimes in great abundance.
Myxine.—One external branchial aperture only on each side of the
abdomen, leading by six ducts to six branchial sacs.
Three species from the North Atlantic, Japan, and Magelhæn’s
Straits.

Fig. 320.—Myxine australis. A, Lower aspect of head; a, Nasal aperture; b, Mouth;


g, Branchial aperture; v, Vent.
Bdellostoma.—Six or more external branchial apertures on each
side, each leading by a separate duct to a branchial sac.
Two species from the South Pacific.

FOURTH SUB-CLASS—LEPTOCARDII.
Skeleton membrano-cartilaginous and notochordal, ribless. No
brain. Pulsating sinuses in place of a heart. Blood colourless.
Respiratory cavity confluent with the abdominal cavity; branchial
clefts in great number, the water being expelled by an opening in
front of the vent. Jaws none.
This sub-class is represented by a single family (Cirrostomi) and
by a single genus (Branchiostoma);[48] it is the lowest in the scale of
fishes, and lacks so many characteristics, not only of this class, but
of the vertebrata generally, that Hæckel, with good reason,
separates it into a separate class, that of Acrania. The various parts
of its organisation have been duly noticed in the first part of this
work.
The “Lancelet” (Branchiostoma lanceolatum, see Fig. 28, p. 63),
seems to be almost cosmopolitan within the temperate and tropical
zones. Its small size, its transparency, and the rapidity with which it
is able to bury itself in the sand, are the causes why it escapes so
readily observation, even at localities where it is known to be
common. Shallow, sandy parts of the coasts seem to be the places
on which it may be looked for. It has been found on many localities of
the British, and generally European coasts, in North America, the
West Indies, Brazil, Peru, Tasmania, Australia, and Borneo. It rarely
exceeds a length of three inches. A smaller species, in which the
dorsal fringe is distinctly higher and rayed, and in which the caudal
fringe is absent, has been described under the name of
Epigionichthys pulchellus; it was found in Moreton Bay.
APPENDIX.
DIRECTIONS FOR COLLECTING AND PRESERVING FISHES.
Whenever practicable fishes ought to be preserved in spirits.
To insure success in preserving specimens the best and
strongest spirits should be procured, which, if necessary, can be
reduced to the strength required during the journey with water or
weaker spirit. Travellers frequently have great difficulties in procuring
spirits during their journey, and therefore it is advisable, especially
during sea voyages, that the traveller should take a sufficient
quantity with him. Pure spirits of wine is best. Methylated spirits may
be recommended on account of their cheapness; however,
specimens do not keep equally well in this fluid, and very valuable
objects, or such as are destined for minute anatomical examination,
should always be kept in pure spirits of wine. If the collector has
exhausted his supply of spirits he may use arrack, cognac, or rum,
provided that the fluids contain a sufficient quantity of alcohol.
Generally speaking, spirits which, without being previously heated,
can be ignited by a match or taper, may be used for the purposes of
conservation. The best method to test the strength of the spirits is
the use of a hydrometer. It is immersed in the fluid to be measured,
and the deeper it sinks the stronger is the spirit. On its scale the
number 0 signifies what is called proof spirit, the lowest degree of
strength which can be used for the conservation of fish for any length
of time. Spirits, in which specimens are packed permanently, should
be from 40 to 60 above proof. If the hydrometers are made of glass
they are easily broken, and therefore the traveller had better provide
himself with three or four of them, their cost being very trifling.
Further, the collector will find a small distilling apparatus very useful.
By its means he is able not only to distil weak and deteriorated spirits
or any other fluid containing alcohol, but also, in case of necessity, to
prepare a small quantity of drinkable spirits.
Of collecting vessels we mention first those which the collector
requires for daily use. Most convenient are four-sided boxes made of
zinc, 18 in. high, 12 in. broad, and 5 in. wide. They have a round
opening at the top of 4 in. diameter, which can be closed by a strong
cover of zinc of 5 in. diameter, the cover being screwed into a raised
rim round the opening. In order to render the cover air-tight, an
indiarubber ring is fixed below its margin. Each of these zinc boxes
fits into a wooden case, the lid of which is provided with hinges and
fastenings, and which on each side has a handle of leather or rope,
so that the box can be easily shifted from one place to another.
These boxes are in fact made from the pattern of the ammunition
cases used in the British army, and extremely convenient, because a
pair can be easily carried strapped over the shoulders of a man or
across the back of a mule. The collector requires at least two, still
better four or six, of these boxes. All those specimens which are
received during the day are deposited in them, in order to allow them
to be thoroughly penetrated by the spirit, which must be renewed
from time to time. They remain there for some time under the
supervision of the collector, and are left in these boxes until they are
hardened and fit for final packing. Of course, other more simple
vessels can be used and substituted for the collecting boxes. For
instance, common earthenware vessels, closed by a cork or an
indiarubber covering, provided they have a wide mouth at the top,
which can be closed so that the spirit does not evaporate, and which
permits of the specimens being inspected at any moment without
trouble. Vessels in which the objects are permanently packed for the
home journey are zinc boxes of various sizes, closely fitting into
wooden cases. Too large a size should be avoided, because the
objects themselves may suffer from the superimposed weight, and
the risk of injury to the case increases with its size. It should hold no
more than 18 cubic feet at most, and what, in accordance with the
size of the specimens, has to be added in length should be deducted
in depth or breadth. The most convenient cases, but not sufficient for
all specimens, are boxes 2 feet in length, 1½ foot broad, and 1 foot
deep. The traveller may provide himself with such cases ready
made, packing in them other articles which he wants during his
journey; or he may find it more convenient to take with him only the
zinc plates cut to the several sizes, and join them into boxes when
they are actually required. The requisite wooden cases can be
procured without much difficulty almost everywhere. No collector
should be without the apparatus and materials for soldering, and he
should be well acquainted with their use. Also a pair of scissors to
cut the zinc plates are useful.
Wooden casks are not suitable for the packing of specimens
preserved in spirits, at least not in tropical climates. They should be
used in cases of necessity only, or for packing of the largest
examples, or for objects preserved in salt or brine.
Very small and delicate specimens should never be packed
together with larger ones, but separately, in small bottles.
Mode of preserving.—All fishes, with the exception of very large
ones (broad kinds exceeding 3–4 feet in length; eel-like kinds more
than 6 feet long), should be preserved in spirits. A deep cut should
be made in the abdomen between the pectoral fins, another in front
of the vent, and one or two more, according to the length of the fish,
along the middle line of the abdomen. These cuts are made partly to
remove the fluid and easily decomposing contents of the intestinal
tract, partly to allow the spirit quickly to penetrate into the interior. In
large fleshy fishes several deep incisions should be made with the
scalpel into the thickest parts of the dorsal and caudal muscles, to
give ready entrance to the spirits. The specimens are then placed in
one of the provisional boxes, in order to extract, by means of the
spirit, the water of which fishes contain a large quantity. After a few
days (in hot climates after 24 or 48 hours) the specimens are
transferred into a second box with stronger spirits, and left therein for
several days. A similar third and, in hot climates sometimes a fourth,
transfer is necessary. This depends entirely on the condition of the
specimens. If, after ten or fourteen days of such treatment the
specimens are firm and in good condition, they may be left in the
spirits last used until they are finally packed. But if they should be
soft, very flexible, and discharge a discoloured bloody mucus, they
must be put back in spirits at least 20° over proof. Specimens
showing distinct signs of decomposition should be thrown away, as
they imperil all other specimens in the same vessel. Neither should
any specimen in which decomposition has commenced when found,
be received for the collecting boxes, unless it be of a very rare
species, when the attempt may be made to preserve it separately in
the strongest spirits available. The fresher the specimens to be
preserved are, the better is the chance of keeping them in a perfect
condition. Specimens which have lost their scales, or are otherwise
much injured, should not be kept. Herring-like fishes, and others with
deciduous scales, are better wrapped in thin paper or linen before
being placed in spirits.
The spirits used during this all-important process of preservation
loses, of course, gradually in strength. As long as it keeps 10° under
proof it may still be used for the first stage of preservation, but
weaker spirits should be re-distilled; or, if the collector cannot do this,
it should be at least filtered through powdered charcoal before it is
mixed with stronger spirits. Many collectors are satisfied with
removing the thick sediment collected at the bottom of the vessel,
and use their spirits over and over again without removing from it by
filtration the decomposing matter with which it has been
impregnated, and which entirely neutralises the preserving property
of the spirits. The result is generally the loss of the collection on its
journey home. The collector can easily detect the vitiated character
of his spirits by its bad smell. He must frequently examine his
specimens; and attention to the rules given, with a little practice and
perseverance, after the possible failure of the first trial, will soon
insure to him the safety of his collected treasures. The trouble of
collecting specimens in spirits is infinitely less than that of preserving
skins or dry specimens of any kind.
When a sufficient number of well-preserved examples have been
brought together, they should be sent home by the earliest
opportunity. Each specimen should be wrapped separately in a piece
of linen, or at least soft paper; the specimens are then packed as
close as herrings in the zinc case, so that no free space is left either
at the top or on the sides. When the case is full, the lid is soldered
on, with a round hole about half an inch in diameter near one of the
corners. This hole is left in order to pour the spirit through it into the
case. Care is taken to drive out the air which may remain between
the specimens, and to surround them completely with spirits, until
the case is quite full. Finally, the hole is closed by a small square lid
of tin being soldered over it. In order to see whether the case keeps
in the spirit perfectly, it is turned upside down and left over night.
When all is found to be securely fastened, the zinc case is placed
into the wooden box and ready for transport.
Now and then it happens in tropical climates that collectors are
unable to keep fishes from decomposition even in the strongest
spirits without being able to detect the cause. In such cases a
remedy will be found in mixing a small quantity of arsenic or
sublimate with the spirits; but the collector ought to inform his
correspondent, or the recipient of the collection, of this admixture
having been made.
In former times fishes of every kind, even those of small size,
were preserved dry as flat skins or stuffed. Specimens thus prepared
admit of a very superficial examination only, and therefore this
method of conservation has been abandoned in all larger museums,
and should be employed exceptionally only, for instance on long
voyages overland, during which, owing to the difficulty of transport,
neither spirits nor vessels can be carried. To make up as much as
possible for the imperfection of such specimens, the collector ought
to sketch the fish before it is skinned, and to colour the sketch if the
species is ornamented with colours likely to disappear in the dry
example. Collectors who have the requisite time and skill, ought to
accompany their collections with drawings coloured from the living
fishes; but at the same time it must be remembered that, valuable as
such drawings are if accompanied by the originals from which they
were made, they can never replace the latter, and possess a
subordinate scientific value only.
Very large fishes can be preserved as skins only; and collectors
are strongly recommended to prepare in this manner the largest
examples obtainable, although it will entail some trouble and
expense. So very few large examples are exhibited in museums, the
majority of the species being known from the young stage only, that
the collector will find himself amply recompensed by attending to
these desiderata.
Scaly fishes are skinned thus: with a strong pair of scissors an
incision is made along the median line of the abdomen from the
foremost part of the throat, passing on one side of the base of the
ventral and anal fins, to the root of the caudal fin, the cut being
continued upwards to the back of the tail close to the base of the
caudal. The skin of one side of the fish is then severed with the
scalpel from the underlying muscles to the median line of the back;
the bones which support the dorsal and caudal are cut through, so
that these fins remain attached to the skin. The removal of the skin
of the opposite side is easy. More difficult is the preparation of the
head and scapulary region; the two halves of the scapular arch
which have been severed from each other by the first incision are
pressed towards the right and left, and the spine is severed behind
the head, so that now only the head and shoulder bones remain
attached to the skin. These parts have to be cleaned from the inside,
all soft parts, the branchial and hyoid apparatus, and all smaller
bones, being cut away with the scissors or scraped off with the
scalpel. In many fishes, which are provided with a characteristic
dental apparatus in the pharynx (Labroids, Cyprinoids), the
pharyngeal bones ought to be preserved, and tied with a thread to
the specimen. The skin being now prepared so far, its entire inner
surface as well as the inner side of the head are rubbed with
arsenical soap; cotton-wool, or some other soft material is inserted
into any cavities or hollows, and finally a thin layer of the same
material is placed between the two flaps of the skin. The specimen is
then dried under a slight weight to keep it from shrinking.
The scales of some fishes, as for instance of many kinds of
herrings, are so delicate and deciduous that the mere handling
causes them to rub off easily. Such fishes may be covered with thin
paper (tissue-paper is the best), which is allowed to dry on them
before skinning. There is no need for removing the paper before the
specimen has reached its destination.
Scaleless Fishes, as Siluroids and Sturgeons, are skinned in the
same manner, but the skin can be rolled up over the head; such
skins can also be preserved in spirits, in which case the traveller
may save to himself the trouble of cleaning the head.
Some Sharks are known to attain to a length of 30 feet, and
some Rays to a width of 20 feet. The preservation of such gigantic
specimens is much to be recommended, and although the difficulties
of preserving fishes increase with their size, the operation is
facilitated, because the skins of all Sharks and Rays can easily be
preserved in salt and strong brine. Sharks are skinned much in the
same way as ordinary fishes. In Rays an incision is made not only
from the snout to the end of the fleshy part of the tail, but also a
second across the widest part of the body. When the skin is removed
from the fish, it is placed into a cask with strong brine mixed with
alum, the head occupying the upper part of the cask; this is
necessary, because this part is most likely to show signs of
decomposition, and therefore most requires supervision. When the
preserving fluid has become decidedly weaker from the extracted
blood and water, it is thrown away and replaced by fresh brine. After
a week’s or fortnight’s soaking the skin is taken out of the cask to
allow the fluid to drain off; its inner side is covered with a thin layer of
salt, and after being rolled up (the head being inside) it is packed in a
cask, the bottom of which is covered with salt; all the interstices and
the top are likewise filled with salt. The cask must be perfectly water-
tight.
Of all larger examples of which the skin is prepared, the
measurements should be taken before skinning so as to guide the
taxidermist in stuffing and mounting the specimens.
Skeletons of large osseous fishes are as valuable as their skins.
To preserve them it is only necessary to remove the soft parts of the
abdominal cavity and the larger masses of muscle, the bones being
left in their natural continuity. The remaining flesh is allowed to dry
on the bones, and can be removed by proper maceration at home.
The fins ought to be as carefully attended to as in a skin, and of
scaly fishes so much of the external skin ought to be preserved as is
necessary for the determination of the species, as otherwise it is
generally impossible to determine more than the genus.
A few remarks may be added as regards those Faunæ, which
promise most results to the explorer, with some hints as to desirable
information on the life and economic value of fishes.
It is surprising to find how small the number is of the freshwater
faunæ which may be regarded as well explored; the rivers of Central
Europe, the Lower Nile, the lower and middle course of the Ganges,
and the lower part of the Amazons are almost the only fresh waters
in which collections made without discrimination would not reward
the naturalist. The oceanic areas are much better known; yet almost
everywhere novel forms can be discovered and new observations
made. Most promising and partly quite unknown are the following
districts:—the Arctic Ocean, all coasts south of 38° lat. S., the Cape
of Good Hope, the Persian Gulf, the coasts of Australia (with the
exception of Tasmania, New South Wales, and New Zealand), many
of the little-visited groups of Pacific islands, the coasts of north-
eastern Asia north of 35° lat. N., and the western coasts of North and
South America.
No opportunity should be lost to obtain pelagic forms, especially
the young larva-like stages of development abounding on the
surface of the open ocean. They can be obtained without difficulty by
means of a small narrow meshed net dragged behind the ship. The
sac of the net is about 3 feet deep, and fastened to a strong brass-
ring 2 or 2½ feet in diameter. The net is suspended by three lines
passing into the strong main line. It can only be used when the
vessel moves very slowly, its speed not exceeding three knots an
hour, or when a current passes the ship whilst at anchor. To keep the
net in a vertical position the ring can be weighted at one point of its
circumference; and by using heavier weights two or three drag-nets
can be used simultaneously at different depths. This kind of fishing
should be tried at night as well as day, as many fishes come to the
surface only after sunset. The net must not be left long in the water,
from 5 to 20 minutes only, as delicate objects would be sure to be
destroyed by the force of the water passing through the meshes.
Objects found floating on the surface, as wood, baskets,
seaweed, etc., deserve the attention of the travellers, as they are
generally surrounded by small fishes or other marine animals.
It is of the greatest importance to note the longitude and latitude
at which the objects were collected in the open ocean.
Fishing in great depths by means of the dredge, can be practised
only from vessels specially fitted out for the purpose; and the
success which attended the “Challenger,” and North American Deep-
sea explorations, has developed Deep-sea fishing into such a
speciality that the requisite information can be gathered better by
consulting the reports of those expeditions than from a general
account, such as could be given in the present work.
Fishes offer an extraordinary variety with regard to their habits,
growth, etc., so that it is impossible to enumerate in detail the points
of interest to which the travellers should pay particular attention.
However, the following hints may be useful.
Above all, detailed accounts are desirable of all fishes forming
important articles of trade, or capable of becoming more generally
useful than they are at present. Therefore, deserving of special
attention are the Sturgeons, Gadoids, Thyrsites and Chilodactylus,
Salmonoids, Clupeoids. Wherever these fishes are found in sufficient
abundance, new sources may be opened to trade.
Exact observations should be made on the fishes the flesh of
which is poisonous either constantly or at certain times and certain
localities; the cause of the poisonous qualities as well as the nature
of the poison should be ascertained. Likewise the poison of fishes
provided with special poison-organs requires to be experimentally
examined, especially with regard to its effects on other fishes and
animals generally.
All observations directed to sex, mode of propagation, and
development, will have special interest: thus those relating to
secondary sexual characters, hermaphroditism, numeric proportion
of the sexes, time of spawning and migration, mode of spawning,
construction of nests, care of progeny, change of form during growth,
etc.
If the collector is unable to preserve the largest individuals of a
species that may come under his observation he should note at least
their measurements. There are but few species of fishes of which the
limit of growth is known.
The history of Parasitic Fishes is almost unknown, and any
observations with regard to their relation to their host as well as to
their early life will prove to be valuable; nothing is known of the
propagation of fishes even so common as Echeneis and Fierasfer,
much less of the parasitic Freshwater Siluroids.
The temperature of the blood of the larger freshwater and marine
species should be exactly measured.
Many pelagic and deep-sea fishes are provided with peculiar
small round organs of a mother-of-pearl colour, distributed in series
along the side of the body, especially along the abdomen. Some
zoologists consider these organs as accessory eyes, others (and it
appears to us with better reason) as luminous organs. They deserve
an accurate microscopic examination made on fresh specimens; and
their function should be ascertained from observation of the living
fishes, especially also with regard to the question, whether or not the
luminosity (if such be their function) is subject to the will of the fish.

Fig. 321.—Scopelus boops, a pelagic fish, with luminous organs.


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!

ebookfinal.com

You might also like