Download ebooks file Essential Algorithms a Practical Approach to Computer Algorithms 1st Edition Rod Stephens all chapters
Download ebooks file Essential Algorithms a Practical Approach to Computer Algorithms 1st Edition Rod Stephens all chapters
com
https://ebookname.com/product/essential-algorithms-a-
practical-approach-to-computer-algorithms-1st-edition-rod-
stephens/
OR CLICK BUTTON
DOWNLOAD EBOOK
https://ebookname.com/product/essential-algorithms-a-practical-
approach-to-computer-algorithms-1st-edition-rod-stephens-2/
ebookname.com
https://ebookname.com/product/essential-algorithms-a-practical-
approach-to-computer-algorithms-using-python-and-c-second-edition-rod-
stephens/
ebookname.com
https://ebookname.com/product/algorithms-in-c-computer-science-
series-1st-edition-sedgewick/
ebookname.com
https://ebookname.com/product/linguistics-an-introduction-2nd-edition-
andrew-radford/
ebookname.com
Current Issues in Theoretical Philosophy Volume 1 What is
Truth
https://ebookname.com/product/current-issues-in-theoretical-
philosophy-volume-1-what-is-truth/
ebookname.com
https://ebookname.com/product/qualities-of-effective-teachers-3rd-
edition-james-h-stronge/
ebookname.com
https://ebookname.com/product/geriatrics-health-and-medical-issues-
today-1st-edition-carol-leth-stone/
ebookname.com
https://ebookname.com/product/the-last-enemy-1st-edition-michael-
eugene-wittmer/
ebookname.com
https://ebookname.com/product/making-new-words-morphological-
derivation-in-english-r-m-w-dixon/
ebookname.com
Stroke What Do I Do Now 2nd Edition Edition Louis R.
Caplan
https://ebookname.com/product/stroke-what-do-i-do-now-2nd-edition-
edition-louis-r-caplan/
ebookname.com
bindex.indd 05:47:54:PM 07/10/2013 Page 602
Essential Algorithms
A Practical Approach to Computer
Algorithms
Rod Stephens
Published by
John Wiley & Sons, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2013 by John Wiley & Sons, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-1-118-61210-1
ISBN: 978-1-118-61276-7 (ebk)
ISBN: 978-1-118-79729-7 (ebk)
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or
by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted
under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permis-
sion of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright
Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the
Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111
River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.
com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or war-
ranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all
warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be
created or extended by sales or promotional materials. The advice and strategies contained herein may not
be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in
rendering legal, accounting, or other professional services. If professional assistance is required, the services
of a competent professional person should be sought. Neither the publisher nor the author shall be liable for
damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation
and/or a potential source of further information does not mean that the author or the publisher endorses
the information the organization or website may provide or recommendations it may make. Further, readers
should be aware that Internet websites listed in this work may have changed or disappeared between when
this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department
within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included
with standard print versions of this book may not be included in e-books or in print-on-demand. If this book
refers to media such as a CD or DVD that is not included in the version you purchased, you may download
this material at http://booksupport.wiley.com. For more information about Wiley products,
visit www.wiley.com.
Trademarks: Wiley and the Wiley logo are trademarks or registered trademarks of John Wiley & Sons, Inc.
and/or its affiliates, in the United States and other countries, and may not be used without written permission.
All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated
with any product or vendor mentioned in this book.
iii
iv
Thanks to Bob Elliott, Tom Dinse, Gayle Johnson, and Daniel Scribner for all
of their hard work in making this book possible. Thanks also to technical edi-
tors George Kocur, Dave Colman, and Jack Jianxiu Hao for helping ensure the
information in this book is as accurate as possible. (Any remaining mistakes
are mine not theirs.)
Introduction xv
Glossary 559
Index 573
vi
Introduction xv
Chapter 1 Algorithm Basics 1
Approach 2
Algorithms and Data Structures 3
Pseudocode 3
Algorithm Features 6
Big O Notation 7
Common Runtime Functions 11
Visualizing Functions 17
Practical Considerations 17
Summary 19
Exercises 20
Chapter 2 Numerical Algorithms 25
Randomizing Data 25
Generating Random Values 25
Randomizing Arrays 31
Generating Nonuniform Distributions 33
Finding Greatest Common Divisors 33
Performing Exponentiation 35
Working with Prime Numbers 36
Finding Prime Factors 37
Finding Primes 39
Testing for Primality 40
Performing Numerical Integration 42
The Rectangle Rule 42
The Trapezoid Rule 43
vii
Adaptive Quadrature 44
Monte Carlo Integration 48
Finding Zeros 49
Summary 51
Exercises 52
Chapter 3 Linked Lists 55
Basic Concepts 55
Singly Linked Lists 56
Iterating Over the List 57
Finding Cells 57
Using Sentinels 58
Adding Cells at the Beginning 59
Adding Cells at the End 60
Inserting Cells After Other Cells 61
Deleting Cells 62
Doubly Linked Lists 63
Sorted Linked Lists 65
Linked-List Algorithms 66
Copying Lists 67
Sorting with Insertionsort 68
Linked List Selectionsort 69
Multithreaded Linked Lists 70
Linked Lists with Loops 71
Marking Cells 72
Using Hash Tables 74
List Retracing 75
List Reversal 76
Tortoise and Hare 78
Loops in Doubly Linked Lists 80
Summary 81
Exercises 81
Chapter 4 Arrays 83
Basic Concepts 83
One-dimensional Arrays 86
Finding Items 86
Finding Minimum, Maximum, and Average 86
Inserting Items 88
Removing Items 89
Nonzero Lower Bounds 89
Two Dimensions 90
Higher Dimensions 91
Triangular Arrays 94
Sparse Arrays 97
Glossary 559
Index 573
Algorithms are the recipes that make efficient programming possible. They
explain how to sort records, search for items, calculate numeric values such as
prime factors, find the shortest path between two points in a street network, and
determine the maximum flow of information possible through a communica-
tions network. The difference between using a good algorithm and a bad one
can mean the difference between solving a problem in seconds, hours, or never.
Studying algorithms lets you build a useful toolkit of methods for solving
specific problems. It lets you understand which algorithms are most effective
under different circumstances so that you can pick the one best suited for a
particular program. An algorithm that provides excellent performance with
one set of data may perform terribly with other data, so it is important that
you know how to pick the algorithm that is the best match for your scenario.
Even more important, by studying algorithms you can learn general problem-
solving techniques that you can apply to other problems even if none of the
algorithms you already know is a perfect fit for your current situation. These
techniques let you look at new problems in different ways so that you can create
and analyze your own algorithms to solve your problems and meet unantici-
pated needs.
In addition to helping you solve problems while on the job, these techniques
may even help you land the job where you can use them! Many large tech-
nology companies, such as Microsoft, Google, Yahoo!, IBM, and others, want
their programmers to understand algorithms and the related problem-solving
techniques. Some of these companies are notorious for making job applicants
work through algorithmic programming and logic puzzles during interviews.
The better interviewers don’t necessarily expect you to solve every puzzle.
In fact, they will probably learn more when you don’t solve a puzzle. Rather
xv
xvi Introduction
than wanting to know the answer, the best interviewers want to see how you
approach an unfamiliar problem. They want to see whether you throw up your
hands and say the problem is unreasonable in a job interview. Or perhaps you
analyze the problem and come up with a promising line of reasoning for using
algorithmic approaches to attack the problem. “Gosh, I don’t know. Maybe I’d
search the Internet,” would be a bad answer. “It seems like a recursive divide-
and-conquer approach might work” would be a much better answer.
This book is an easy-to-read introduction to computer algorithms. It describes
a number of important classical algorithms and tells when each is appropri-
ate. It explains how to analyze algorithms to understand their behavior. Most
importantly, it teaches techniques that you can use to create new algorithms
on your own.
Here are some of the useful algorithms this book describes:
■ Numerical algorithms such as randomization, factoring, working with
prime numbers, and numeric integration
■ Methods for manipulating common data structures such as arrays, linked
lists, trees, and networks
■ Using more-advanced data structures such as heaps, trees, balanced trees,
and B-trees
■ Sorting and searching
■ Network algorithms such as shortest path, spanning tree, topological
sorting, and flow calculations
Here are some of the general problem-solving techniques this book explains:
■ Brute-force or exhaustive search
■ Divide and conquer
■ Backtracking
■ Recursion
■ Branch and bound
■ Greedy algorithms and hill climbing
■ Least-cost algorithms
■ Constricting bounds
■ Heuristics
To help you master the algorithms, this book provides exercises that you
can use to explore ways you can modify the algorithms to apply them to new
situations. This also helps solidify the main techniques demonstrated by the
algorithms.
Introduction xvii
Finally, this book includes some tips for approaching algorithmic questions
that you might encounter in a job interview. Algorithmic techniques let you
solve many interview puzzles. Even if you can’t use algorithmic techniques
to solve every puzzle, you will at least demonstrate that you are familiar with
approaches that you can use to solve other problems.
Algorithm Selection
Each of the algorithms in this book was included for one or more of the fol-
lowing reasons:
■ The algorithm is useful, and a seasoned programmer should be expected
to understand how it works and use it in programs.
■ The algorithm demonstrates important algorithmic programming tech-
niques you can apply to other problems.
■ The algorithm is commonly studied by computer science students, so the
algorithm or the techniques it uses could appear in a technical interview.
After reading this book and working through the exercises, you will have a
good foundation in algorithms and techniques you can use to solve your own
programming problems.
NOTE Personally, I think algorithms are just plain fun! They’re my equivalent of
crossword puzzles or Sudoku. I love the feeling of putting together a complicated
algorithm, dumping some data into it, and seeing a beautiful three-dimensional
image, a curve matching a set of points, or some other elegant result appear!
NOTE At the Wiley web site, you may find it easiest to search by ISBN. This
book’s ISBN is 978-1-118-61210-1.
Introduction xix
and implement, although they also sometimes lead to problems, so this chapter
also describes how to remove recursion from an algorithm when necessary.
Chapter 10, “Trees,” explains highly recursive tree data structures, which
are useful for storing, manipulating, and studying hierarchical data and have
applications in unexpected places, such as evaluating arithmetic expressions.
Chapter 11, “Balanced Trees,” explains trees that remain balanced as they
grow over time. In general, tree structures can grow very tall and thin, and that
can ruin the performance of tree algorithms. Balanced trees solve this problem
by ensuring that a tree doesn’t grow too tall and skinny.
Chapter 12, “Decision Trees,” explains algorithms that attempt to solve
problems that can be modeled as a series of decisions. These algorithms are
often used on very hard problems, so they often find only approximate solutions
rather than the best solution possible. However, they are very flexible and can
be applied to a wide range of problems.
Chapter 13, “Basic Network Algorithms,” explains fundamental network
algorithms such as visiting all the nodes in a network, detecting cycles, creating
spanning trees, and finding paths through a network.
Chapter 14, “More Network Algorithms,” explains more network algorithms,
such as topological sorting to arrange dependent tasks, graph coloring, network
cloning, and assigning work to employees.
Chapter 15, “String Algorithms,” explains algorithms that manipulate strings.
Some of these algorithms, such as searching for substrings, are built into tools
that most programming languages can use without customized programming.
Others, such as parenthesis matching and finding string differences, require
some extra work and demonstrate useful techniques.
Chapter 16, “Cryptography,” explains how to encrypt and decrypt information.
It covers the basics of encryption and describes several interesting encryption
techniques, such as Vigenère ciphers, block ciphers, and public key encryption.
This chapter does not go into all the details of specific encryption algorithms such
as DES (Data Encryption Standard) and AES (Advanced Encryption Standard),
because they are more appropriate for a book on encryption.
Chapter 17, “Complexity Theory,” explains two of the most important classes
of problems in computer science: P (problems that can be solved in determinis-
tic polynomial time) and NP (problems that can be solved in nondeterministic
polynomial time). This chapter describes these classes, ways to prove that a
problem is in one or the other, and the most profound question in computer
science: Is P equal to NP?
Chapter 18, “Distributed Algorithms,” explains algorithms that run on
multiple processors. Almost all modern computers contain multiple processors,
and computers in the future will contain even more, so these algorithms are
essential for getting the most out of a computer’s latent power.
Introduction xxi
Chapter 19, “Interview Puzzles,” describes tips and techniques you can use
to attack puzzles and challenges that you may encounter during a program-
ming interview. It also includes a list of some websites that contain large lists
of puzzles that you can use for practice.
Appendix A, “Summary of Algorithmic Concepts,” summarizes the ideas
and strategies used by the algorithms described in this book. Using these, you
can build solutions to other problems that are not specifically covered by the
algorithms described here.
Appendix B, “Solutions to Exercises,” contains the solutions to the exercises
at the end of each chapter.
The Glossary defines important algorithmic concepts that are used in this book.
You may want to review the Glossary before going on programming interviews.
Conventions
To help you get the most from the text and keep track of what’s happening, I’ve
used several conventions throughout the book.
SPLENDID SIDEBARS
Sidebars such as this one contain additional information and side topics.
WARNING Warning boxes like this hold important, not-to-be forgotten infor-
mation that is directly relevant to the surrounding text.
NOTE Boxes like this hold notes, tips, hints, tricks, and asides to the current
discussion.
Email Me
If you have questions, comments, or suggestions, please feel free to email me at
RodStephens@CSharpHelper.com. I can’t promise to solve all your algorithmic
problems, but I do promise to try to point you in the right direction.
CHAPTER
Algorithm Basics
Before you jump into the study of algorithms, you need a little background. To
begin with, you need to know that, simply stated, an algorithm is a recipe for
getting something done. It defines the steps for performing a task in a certain way.
That definition seems simple enough, but no one writes algorithms for per-
forming extremely simple tasks. No one writes instructions for how to access
the fourth element in an array. It is just assumed that this is part of the defini-
tion of an array and that you know how to do it (if you know how to use the
programming language in question).
Normally people write algorithms only for difficult tasks. Algorithms explain
how to find the solution to a complicated algebra problem, how to find the short-
est path through a network containing thousands of streets, or how to find the
best mix of hundreds of investments to optimize profits.
This chapter explains some of the basic algorithmic concepts you should
understand if you want to get the most out of your study of algorithms.
It may be tempting to skip this chapter and jump to studying specific
algorithms, but you should at least skim this material. Pay close attention to the
section “Big O Notation,” because a good understanding of runtime performance
can mean the difference between an algorithm performing its task in seconds,
hours, or not at all.
1
Random documents with unrelated
content Scribd suggests to you:
CARDENIO’S SONG, by Motteux
I
What makes me languish and complain?
O, ’tis Disdain!
What yet more fiercely tortures me?
’Tis Jealousy.
How have I my patience lost?
By Absence crost.
Then Hope, farewell, there’s no relief;
I sink beneath oppressing grief;
Nor can a wretch, without despair,
Scorn, Jealousy, and Absence, bear.
II
What in my breast this anguish drove?
Intruding Love.
Who could such mighty ills create?
Blind Fortune’s hate.
What cruel powers my fate approve?
The Powers above.
Then let me bear, and cease to moan;
’Tis glorious thus to be undone:
When these invade, who dares oppose?
Heaven, Love, and Fortune are my foes.
III
Where shall I find a speedy cure?
Oh! Death is sure.
No milder means to set me free?
Inconstancy.
Can nothing else my pains assuage?
Distracting Rage.
What, die or change? Lucinda lose?
O let me rather madness chuse!
O et e at e ad ess c use
But judge, ye gods, what we endure,
When death or madness are a cure!
In the last four lines, Motteux has used more liberty with the
thought of the original than is allowable for a translator. It must be
owned, however, that he has much improved it.
CARDENIO’S SONG, by Smollet
I
Ah! what inspires my woful strain?
Unkind Disdain!
Ah! what augments my misery?
Fell Jealousy!
Or say what hath my patience worn?
An absent lover’s scorn!
The torments then that I endure
No mortal remedy can cure:
For every languid hope is slain
By Absence, Jealousy, Disdain.
II
From Love, my unrelenting foe,
These sorrows flow:
My infant glory’s overthrown
By Fortune’s frown.
Confirm’d in this my wretched state
By the decrees of Fate,
In death alone I hope release
From this compounded dire disease,
Whose cruel pangs to aggravate,
Fortune and Love conspire with Fate!
III
Ah! what will mitigate my doom?
The silent tomb.
Ah! what retrieve departed joy?
Inconstancy!
Or say, can ought but frenzy bear
This tempest of despair!
All other efforts then are vain
To cure this soul-tormenting pain,
o cu e t s sou to e t g pa ,
That owns no other remedy
Than madness, death, inconstancy.
New Terms:
Paradise Lost, b. 6.
Shak. K. Lear.
Ibid.
Can any mortal mixture of Earth’s mould,
Breathe such divine, enchanting ravishment?
Sure something holy lodges in that breast,
And with these raptures moves the vocal air
To testify his hidden residence:
How sweetly did they float upon the wings
Of silence, through the empty-vaulted night;
At every fall smoothing the raven down
Of darkness till it smil’d: I have oft heard,
Amidst the flow’ry-kirtled Naiades,
My mother Circe, with the Sirens three,
Culling their potent herbs and baleful drugs,
Who, as they sung, would take the poison’d soul
And lap it in Elysium.——
But such a sacred, and home-felt delight,
Such sober certainty of waking bliss,
I never heard till now.
Milton’s Comus.
“Surely this bird is not to be set in the last place of those that
deserve admiration; for is it not a wonder, that so loud and clear a
voice should come from so little a body? Is it not as strange, that
shee should hold her wind so long, and continue with it as shee
doth? Moreover, shee alone in her song keepeth time and measure
truly, she riseth and falleth in her note just with the rules of music,
and perfect harmony; for one while, in one entire breath she drawes
out her tune at length treatable; another while she quavereth, and
goeth away as fast in her running points: sometimes she maketh
stops and short cuts in her notes; another time she gathereth in her
wind, and singeth descant between the plain song: she fetcheth in
her breath again, and then you shall have her in her catches and
divisions: anon, all on a sudden, before a man would think it, she
drowneth her voice that one can scarce heare her; now and then
she seemeth to record to herself, and then she breaketh out to sing
voluntarie. In sum, she varieth and altereth her voice to all keies:
one while full of her largs, longs, briefs, semibriefs, and minims;
another while in her crotchets, quavers, semiquavers, and double
semiquavers: for at one time you shall hear her voice full of loud,
another time as low; and anon shrill and on high; thick and short
when she list; drawn out at leisure again when she is disposed; and
then, (if she be so pleased), shee riseth and mounteth up aloft, as it
were with a wind organ. Thus shee altereth from one to another,
and sings all parts, the treble, the mean, and the base. To conclude,
there is not a pipe or instrument devised with all the art and cunning
of man, that can affoord more musick than this pretty bird doth out
of that little throat of hers.—They strive who can do best, and one
laboreth to excel another in variety of song and long continuance;
yea, and evident it is that they contend in good earnest with all their
will and power: for oftentimes she that hath the worse, and is not
able to hold out with another, dieth for it, and sooner giveth she up
her vitall breath, than giveth over her song.”
The consideration of the above passage in the original, leads to
the following remark.
5. There is no species of writing so difficult to be translated, as
that where the character of the style is florid, and the expression
consequently vague, and of indefinite meaning. The natural history
of Pliny furnishes innumerable examples of this fault; and hence it
will ever be found one of the most difficult works to be translated. A
short chapter shall be here analyzed, as an instructive specimen.
Lib. 11, Cap. 2.
In magnis siquidem corporibus, aut certe majoribus, facilis officina
sequaci materia fuit. In his tam parvis atque tam nullis, quæ ratio,
quanta vis, quam inextricabilis perfectio! Ubi tot sensus collocavit in
culice? Et sunt alia dictu minora. Sed ubi visum in eo prætendit? Ubi
gustatum applicavit? Ubi odoratum inseruit? Ubi vero truculentam
illam et portione maximam vocem ingeneravit? Qua subtilitate
pennas adnexuit? Prælongavit pedum crura? disposuit jejunam
caveam, uti alvum? Avidam sanguinis et potissimum humani sitim
accendit? Telum vero perfodiendo tergori, quo spiculavit ingenio?
Atque ut in capaci, cum cerni non possit exilitas, ita reciproca
geminavit arte, ut fodiendo acuminatum, pariter sorbendoque
fistulosum esset. Quos teredini ad perforanda robora cum sono teste
dentes affixit? Potissimumque e ligno cibatum fecit? Sed turrigeros
elephantorum miramur humeros, taurorumque colla, et truces in
sublime jactus, tigrium rapinas, leonum jubas; cùm rerum natura
nusquam magis quam in minimis tota sit. Quapropter quæso, ne
hæc legentes, quoniam ex his spernunt multa, etiam relata fastidio
damnent, cùm in contemplatione naturæ, nihil possit videri
supervacuum.
Although, after the perusal of the whole of this chapter, we are at
no loss to understand its general meaning, yet when it is taken to
pieces, we shall find it extremely difficult to give a precise
interpretation, much less an elegant translation of its single
sentences. The latter indeed may be accounted impossible, without
the exercise of such liberties as will render the version rather a
paraphrase than a translation. In magnis siquidem corporibus, aut
certe majoribus, facilis officina sequaci materiæ fuit. The sense of
the term magnus, which is in itself indefinite, becomes in this
sentence much more so, from its opposition to major; and the
reader is quite at a loss to know, whether in those two classes of
animals, the magni and the majores, the largest animals are
signified by the former term, or by the latter. Had the opposition
been between magnus and maximus, or major and maximus, there
could not have been the smallest ambiguity. Facilis officina sequaci
materiæ fuit. Officina is the workhouse where an artist exercises his
craft; but no author, except Pliny himself, ever employed it to signify
the labour of the artist. With a similar incorrectness of expression,
which, however, is justified by general use, the French employ
cuisine to signify both the place where victuals are dressed, and the
art of dressing them. Sequax materia signifies pliable materials, and
therefore easily wrought; but the term sequax cannot be applied
with any propriety to such materials as are easily wrought, on
account of their magnitude or abundance. Tam parvis is easily
understood, but tam nullis has either no meaning at all, or a very
obscure one. Inextricabilis perfectio. It is no perfection in anything to
be inextricable; for the meaning of inextricable is, embroiled,
perplexed, and confounded. Ubi tot sensus collocavit in culice? What
is the meaning of the question ubi? Does it mean, in what part of
the body of the gnat? I conceive it can mean nothing else: And if so,
the question is absurd; for all the senses of a gnat are not placed in
any one part of its body, any more than the senses of a man. Dictu
minora. By these words the author intended to convey the meaning
of alia etiam minora possunt dici; but the meaning which he has
actually conveyed is, Sunt alia minora quam quæ dici possunt, which
is false and hyperbolical; for no insect is so small that words may not
be found to convey an idea of its size. Portione maximam vocem
ingeneravit. What is portione maximam? It is only from the context
that we guess the author’s meaning to be, maximam ratione
portionis, i. e. magnitudinis insecti; for neither use, nor the analogy
of the language, justify such an expression as vocem maximam
portione. If it is alledged, that portio is here used to signify the
power or intensity of the voice, and is synonymous in this place to
vis, ενεργεια, we may safely assert, that this use of the term is
licentious, improper, and unwarranted by custom. Jejunam caveam
uti alvum; “a hungry cavity for a belly:” but is not the stomach of all
animals a hungry cavity, as well as that of the gnat? Capaci cum
cernere non potest exilitas. Capax is improperly contrasted with
exilis, and cannot be otherwise translated than in the sense of
magnus. Reciproca geminavit arte is incapable of any translation
which shall render the proper sense of the words, “doubled with
reciprocal art.” The author’s meaning is, “fitted for a double
function.” Cum sono teste is guessed from the context to mean, uti
sonus testatur. Cum rerum natura nusquam magis quam in minimis
tota sit. This is a very obscure expression of a plain sentiment, “The
wisdom and power of Providence, or of Nature, is never more
conspicuous than in the smallest bodies.” Ex his spernunt multa. The
meaning of ex his is indefinite, and therefore obscure: we can but
conjecture that it means ex rebus hujusmodi; and not ex his quæ
diximus; for that sense is reserved for relata.
From this specimen, we may judge of the difficulty of giving a just
translation of Pliny’s Natural History.
CHAPTER XIV
OF BURLESQUE TRANSLATION.—TRAVESTY AND PARODY.—SCARRON’S VIRGILE
TRAVESTI.—ANOTHER SPECIES OF LUDICROUS TRANSLATION.
In Virgil, the prizes are suitable to the dignity of the persons who
contend for them:
Miles et navigator,
Sartor et ærator,
Jamdudum litigabant,
De pulchra quam amabant,
Nomen cui est Joanna, &c.