Monday, September 11, 2017

Best Algorithms Books (Part 2)

He had read much, if one considers his long life; but his contemplation was much more than his reading. He was wont to say that if he had read as much as other men he should have known no more than other men (italics mine)
~ Isaac Asimov (my late Dad was a Sci Fi buff, and Asimov was one of his fav authors)
Today is September 11, and as Americans, what better way to put our patriotism into practice than by ๐Ÿ‡บ๐Ÿ‡ธ Helping those affected by Hurricane Irma (Florida) and ๐Ÿ‡บ๐Ÿ‡ธ continue helping those affected by Hurricane Harvey (Texas)
This was the first graph problem I ever posed myself and solved. The amazing thing was that I didn't publish it. It was not amazing at the time. At the time, algorithms were hardly considered a scientific topic.
~ Edsger W. Dijkstra (
as quoted by Dennis Shasha and Cathy Lazere in Out of their Minds: The Lives and Discoveries of 15 Great Computer Scientists (Copernicus))  
You’ve Come a Long Way, Baby (Or Have You?)
~ Ruth Rosen 
A lot of careers are based on a perceived need and people find ways to solve critical problemsmedical careers, for examplewhile while other careers like computer science are chosen because of the kind of mind structure that you develop as a child.
~ Donald Knuth
I refuse to accept the view that mankind is so tragically bound to the starless midnight of racism and war that the bright daybreak of peace and brotherhood can never become a reality... I believe that unarmed truth and unconditional love will have the final word.
~ Martin Luther King, Jr.
Sometimes I will stay up in my room for a day trying to get two sentences that will flow, that will just seem as if they were always there.
~ Maya Angelou, 
in Conversations with Maya Angelou, ed. Jeffrey M. Elliot (Jackson, MS: University Press of Mississippi, 1989), p.59 
First, thank you all so much for the warm reception that you've given to the first installment in this series of reviews of algorithms books, by way of an earlier essay—post really, though I've become enamored of calling them essays, after Paul Graham's trendy essays—which was entitled Best Algorithms Books (Part 1) ๐ŸŽ‰

In this essay, which has that trailing "Part 2" in its name, I'm making good on my promise—one that I made toward the end of the previous installment in this seriesof a second installment. In a tangential sort of way, the numbering I've used here for the five books (reflecting their relative ranking), and for which we'll soon be doing a deep dive, is inspired by legendary computer scientist Donald Knuth's Potrzebie system of weights and measures ๐Ÿ˜†

Look, I might be recalcitrant at times, when it comes to digressing in my essays, but I'm not incorrigible, at least I hope not lol; I trust that my occasional obstinacy in digressing does not come across as bordering on impudence. Rest assured that, this time around anywayunlike the previous installment where digressions were center squaredigressions will appear only after the essay proper ๐Ÿ˜‰

So here we go, starting with a ranking of the second half of the top ten algorithms books of all time—the top five, of course, were covered in the prior essay, entitled Best Algorithms Books (Part 1). Here, then, are the next five stellar books on the enduringly evergreen subject of algorithms ๐ŸŒณ
6.  Algorithm Design and Applications (Wiley) by Michael T. Goodrich and Roberto Tamassia ๐ŸŒฟ
7.  Algorithmics: The Spirit of Computing 3rd Edition (Springer) by David Harel and Yishai Feldman ๐Ÿ€
8.  Pearls of Functional Algorithm Design (Cambridge University Press) by Richard Bird ๐ŸŒต
9.  How to Think About Algorithms (Cambridge University Press) by Jeff Edmonds ๐ŸŒด
10. Algorithms Unplugged (Springer) by Berthold Vรถcking et al ๐ŸŒฒ
Since writing the prior essay on algorithms, I'm even more convinced that there is no subject in computer science—at least from a practitioner's perspective—more central to its vitality than that of algorithms. In a nod to an observation I had made elsewhere, I'm eagerly thinking here to how my fascination with algorithms, and in particular their rich applicability to distributed programming, would have us travel back through the mists of time; OK, just kidding, so I'm not that old ๐Ÿ™‰
If you squint hard at the pic above—I surreptitiously dragged it in since we got to digressing, even if ever so briefly, about traveling back through the mists of time—you'll note the shadowy presence of your blog writer in an act of taking a virtuously recursive pic ๐ŸŽƒ Oh, and speaking of art, we should sometime chat about the time when my childhood buddy (who also happens to be my nephew) and I took an awesome tour of the mind-blowing Solomon R. Guggenheim Museum in New York City, nearly two decades ago๐ŸŽข 

๐Ÿ”ฆ Mild alert regarding strongly opinionated and iconoclastic views ahead—though I hasten to assure you that it's all polite discourse throughout—and where I, gasp, bypass CLRS yet again in my take on  the pursuit of algorithmic excellence ๐Ÿ”ฆ

So, following on the heels of the first installment—Best Algorithms Books (Part 1)—in this series, I  now present an equally opinionated look at another set of outstanding books on algorithms, those in the list above. I will, though, be casting a glance back at my constantly-in-progress, and happily interminable, trek through the fascinating land of algorithms. As I do so, I'll be taking an opinionated look at the following books, in turn. With that, I present to you the second set of books that have proved incredibly helpful to me in grokking algorithms ⚽ ⚾ ๐Ÿ€ ๐Ÿˆ ๐ŸŽพ ๐ŸŠ ๐Ÿƒ ๐Ÿ†

I came upon this remarkable book by sheer accident, while doing an online search for background material in connection with the forerunner of this book—Data Structures and Algorithms in Java 6th Edition (Wiley), one of whose three authors (Roberto Tamassia) also happens to be the coauthor of this fine book: Algorithm Design and Applications (Wiley) by Michael T. Goodrich and Roberto Tamassia ๐Ÿ†

Capturing the essence of Algorithm Design and Applications is made difficult by the fact that there is so much that is so good about it. But let's try. So the best analogy I can draw is by way of saying that if you took Data Structures and Algorithms in Java 6th Edition—a book that has an unwavering, laser-sharp focus on sticking to just the basic facts (Pink Floyd, anyone?)—and had it do a deep dive into the ocean that lurks beneath the surface to truly revel in the wonders of the teeming depths of uncompromising rigor, then you would get this amazing book, Algorithm Design and Applications.
I'll need some information first
Just the basic facts

~ Roger Waters (lyrics from the Pink Floyd song Comfortably Numb)
If you're looking to read only one algorithms book (to pick from this second set of books), look no farther than this extraordinarily well done volume. In its pages, you can unhurried stroll through the vistas of algorithm design, with a resoundingly emphatic nod to, and emphasis on design. If you're wanting to get to know the nuts and bolts of algorithms in an intelligent and pragmatic way—you know, roll up our sleeves and learn sufficiently and solidly enough to get the job done way?—then this book's precursor of sorts (Data Structures and Algorithms in Java 6th Edition) would be a great choice.

However, should you wish to go deeper, much deeper, and with decidedly greater nuance and sophistication, then this book—Algorithm Design and Applications—may well be the book for you. It's seemingly simple presentation style belies incredible depth, which simply couldn't have just happened by accident; that depth is hard to convey. You really do have to get your hands on this gem to see for yourself its sparkling offerings on shedding a flood of light to reveal the vast vistas that inhere in the land of algorithms. So kudos to the authors—Professor Goodrich (UC Irvine) and Professor Tamassia (Brown University)—for distilling their design wisdom into the pages of this gem.

I say: High commendations from a fellow craftsman who plies the serene—and at times turbulently creative—seas of computer science in the unrelenting quest to elevate his programming skills to the next level, in his own wayward ways (oxymoron alert) ๐Ÿ„ So awesome is Algorithm Design and Applications that I was compelled to look for anything else published by its authors...

And guess what? Yep, I did find, and buy, yet another fine book by the same authors, yay ๐ŸŽ“ That one is entitled Handbook of Graph Drawing and Visualization: Discrete Mathematics and Its Applications by Roberto Tamassia and it's looking really good. Now if I can only make time to read it in any depth; till then, I'll try to save it from languishing in my library-inbox of sorts ๐Ÿ“ฌ

My formula there, in selecting books for study, is blindingly simple in that all I do is remind myself: Akram, you found something good, now you stick to it! That's it ๐Ÿ™‹ That's why I have a handful of authors whose work I like so much that I'll simply buy and read anything they write. Period. Should you be interested in their work, I invite you to check out an essay I wrote a while ago, called Top Thought Leaders to Follow. In there, you'll meet not only familiar luminaries of our field—Martin Fowler and Robert “Uncle Bob” Martin, just to name two—but also other thought leaders whose names may be less familiar: Allow me to introduce to you, for example, Elizabeth Grace Saunders, Salman Khan, and Cal Newport. Their trailblazing work is not to be missed ๐Ÿ™‡

So I was saying... Having discovered—in recent years, actually—in Algorithm Design and Applications a treasure trove of design wizardry, I'm still hacking away at the nuggets that I keep uncovering in its glorious pages, as and when I can make time. Ah time, most precious of commodities that thou art, if only we could find ways to manage thee, and manage thee well ⏳⏰⌛

Algorithm Design and Applications is replete with tasteful illustrations, which are neither overdone nor cheesy. It's got tons of crystal-clear presentations of theorems, along with accompanying proofs that are, IMHO, marvels of elegance and beauty. Truth be told, had I given more thought to it earlier—given the premium that I, as a software craftsman, place on pursuing the nexus between beautiful code and beautiful proseAlgorithm Design and Applications may well have landed in the top spot of my best algorithms books of all time ๐Ÿ’ฏ

While a paperback edition is not available at this time, I can only recommend plunking down the extra money to get a hardcover copy of Algorithm Design and Applications. Trust me, I don't have a cent to make off of the sales of this book ๐Ÿ’ฐ ๐Ÿ’ฒ ๐Ÿ’ต ๐Ÿ˜ฑ But as a writer who's committed to serving his readers, I feel compelled to share with you the fruits of my research labors: Share with you all that I've found—and continue to find—about what works, and what doesn't, what's truly useful, and what isn't ๐Ÿ’ช

Though I have the ebook version of this book as well, I find it far more effective to study the physical book—highlighter in hand, plus a stash of tape flags with which to mark up the pages close at hand, too. Surely there is a method to the madness, something like a visual variant of coding and cataloging, inspired by the venerable Dewey Decimal system that permeates our libraries, or at least it used to, last time I checked, many moons ago, as a graduate student at Texas A&M University ๐ŸŒ›

Speaking of a method to the madness, I may well be in good company because I find myself reminded of a marvelous passage that I savored a few years ago, in the wise and scintillating pages of the book The Distraction Addiction: Getting the Information You Need and the Communication You Want, Without Enraging Your Family, Annoying Your Colleagues, and Destroying Your Soul

The author of the preceding book (Alex Soojung-Kim Pang) unabashedly went for it when selecting that whale-like title for his book lol, didn't he? ๐Ÿณ Anyhow, he notes with stellar prescience how
As Elizabeth Dunn, an anthropologist at the University of Colorado–Boulder, put it, "If I can skim it, I read it on Kindle, but if I really have to know it, I need a printed page. Work I have to really concentrate on and know, anything I have to annotate, and poetry are all impossible to read on the Kindle. I cannot retain enough of what I read on Kindle to use it for things I will have to work to master." Stephen Herrod, the chief technology officer of VMWare, concurs. He’ll take his Kindle on the road, but "I tend to print out deeper articles from the web if I know I’ll need to think more about them." 
Books and print are valuable when you need to read intensively and with few distractions. What’s interesting is that reading books is often a very physical kind of reading. People talk about having to underline, annotate, and move between several books at once in order to engage in a kind of nonlinear, cross-textual reading. Novelist Nancy Etchemendy said, "If I’m going to use a book for reference or for mastering a difficult body of material, I find it helpful to annotate and bookmark.  
It is still impractical to do those things on e-readers." Microsoft Research scientist Ho John Lee says, "If I receive something important online, I print it out first, so I can spread it out, mark it up, and make notes. I never do any important sustained reading online." The stability of physical books is also useful for people with strong visual memories. Dunn remembers ideas by visualizing their physical location on the page. If she reads a book on a Kindle, she “can’t remember a thing about a book beyond its general argument.”  
Consequently, "I do almost all of my labor and thought-intensive reading in print form." For me, serious reading involves marking up, underlining, and annotating books; it’s a martial art, and it requires the material engagement and support that paper can provide and that screens conspicuously lack. Fifty years ago, MIT professor and hypertext pioneer Vannevar Bush imagined we’d do this kind of intensive, interactive, relational reading on the memex, an electronic system he proposed in 1945. Today, people who really have to know their stuff still choose paper.
So I was saying... No doubt we've all grown accustomed—in any given technical book that's worth its salt—to the exercises which routinely appear at the end of any given chapter. Well, be prepared to be wowed by what Algorithm Design and Applications does in this department: While this book does have all that, and then some, what truly sets it apart is the way those end-of-chapter exercises are thematically organized. Here's the deal: To guide the reader in maximizing her reading experience, the authors have arranged the exercises in thematic chunks, labeled Reinforcement, Creativity, and Applications, respectively.

Here is an example each of those thematic chunks—Reinforcement, Creativity, and Applications—that will hopefully give you a flavor of what to expect in the thematically arranged end-of-chapter exercises:
Example—Show that the best-case running time of quick-sort on a sequence of size n with distinct elements is O(n log n). 
Example—Let A be a collection of objects. Describe an efficient method for converting A into a set. That is, remove all duplicates from A. What is the running time of this method? 
Example—Bob has a set, A, of n nuts and a set, B, of n bolts, such that each nut has a unique matching bolt. Unfortunately, the nuts in A all look the same, and the bolts in B all look the same as well. The only comparison that Bob can make is to take a nut-bolt pair (a, b), such that a ∈ A and b ∈ B, and test if the threads of a are larger, smaller, or a perfect match with the threads of b. Describe an efficient algorithm for Bob to match up all of his nuts and bolts. What is the running time of this algorithm?
Only one other algorithms book comes to mind that comes somewhat close to this one in the department of high caliber end-of-chapter exercises: Algorithm Design (Pearson) by Jon Kleinberg and ร‰va Tardos.

Oh, and as if that weren't enough, the authors of Algorithm Design and Applications round out each chapter with a cogent set of notes that include tips on how best to pursue a given topic in even greater depth—all I can say is, "Guys, can you please have your marketing department do a better job of making this gem of a beautiful book more widely known?!"

So here's a question: Why does CLRS get all the limelight when most all of us in the programming community are practitioners, and not researchers. And yes, most of us aren't into bondage-and-discipline languages either, as hilariously defined in the The New Hacker's Dictionary, Third Edition. We prefer our algorithmic resources to be written for normal people; I hasten to point out that The MIT Press has other books which are consistently at the right level of difficulty and comprehension and are, frankly, plain awesome!

And then we had this aberration in the form of CLRS, alas. Cryptic notations that I have neither the time nor the inclination to master in order to wade through the morass of equally enigmatic coverage. I concede that CLRS is peerless when it comes to the matter of a single resource for finding references to the sprawling literature on the genteel subject of algorithms—well, it used to be a courtly subject until folks started putting the substantial algorithmic literature to their remarkable advantage and in the process propelling their businesses into the upper stratosphere of profitability ๐Ÿš€

As a sucker for adorning—some might say embellishing, though I'll politely beg to differ—essays with topical quotes, images, and excerpts to create a pleasurable reading experience, I was pleased by the way each chapter in Algorithm Design and Applications starts out with an endearing photo each that is refreshingly black-and-white and nicely complements the theme of any given chapter. For example, the theme of Chapter 16—Network Flow and Matching—is pleasingly accentuated by an endearing photo of Yellowstone Falls (1941) by Ansel Adams ๐Ÿ‘ ๐Ÿข ๐Ÿ ๐Ÿž ๐ŸŒ

I love this book. Don't miss it. It will help you elevate your programming skills, plus—and more importantly so, your design skills—to the next level. Again, the uncompromising commitment to help the reader become the best designer she can be is evident and writ large throughout the pages of Algorithm Design and Applications. In the process of reading it, learning ceases to be a chore and instead becomes true pleasure. Yes, it is one of those rare books ๐Ÿ

Before moving on to the next algorithms book in this opinionated essay, I confess that I would have—if only I could turn back the hands of time—put this book in the pantheon of my top five algorithms books, which you hopefully enjoyed finding more about in the previous installment of this series of deep-dive reviews into the algorithms genre. So I ruefully ask of you to please keep this in mind as you continue to revisit this series of deep-dive reviews.


Here's a confession that I feel compelled to make: I've never been terribly impressed by the publishing quality of the books published by Springer—with some notable exceptions—and while this book is an improvement, it sure could have used a better format. Look, every book simply cannot hope to have a premier quality format like that of Algorithms 4th Edition (Addison-Wesley) by Robert Sedgewick and Kevin Wayne, which, as many of you will recall, got the top spot in Best Algorithms Books (Part 1).

There should IMHO, however, be a modicum of quality to enhance the reading experience ☕ And here I bring closure to the thought on a happy note  Springer has redeemed itself by publishing another book of excellent quality, reaffirming my faith in what their publication quality can be. Plus you don't have to go far to get the scoop on that book—Algorithms Unplugged (Springer) by Berthold Vรถcking et al—since it happens to be in the tenth spot in our list of the top 10 algorithms books (Should I do a third installment of this series of essays in the future, then we would naturally get the top 15 algorithms books; that may or may not happen, depending on reader interest, which BTW has been tremendous so far woohoo). Anyhow, we'll get to Algorithms Unplugged in short order. Stay tuned ๐ŸŽฌ ๐ŸŽ ๐ŸŽฏ

Meanwhile, we return to the seventh book in our list. So the second book on our list has content that is nearly unmatched in the length and breadth of the computer science and programming literature. Ladies and gentlemen, rest assured that the stellar content of this book—and allow me to introduce Algorithmics: The Spirit of Computing 3rd Edition (Springer) by David Harel and Yishai Feldman—more than makes up for the, um, less than stellar book format, which is not too shabby either. By the way, there are no problems whatsoever with the ebook, of which I also own a copy; ah yes, the digital media remains unencumbered by the frailties that sometimes attend the physical media ⛳

The reason Algorithmics got such a high spot on the list is its stellar content, the likes of which I have yet to see anywhere else! Dr Stan Scott, with Queen's University (Belfast, Ireland), probably put it the best when he noted in The Times Higher Education Supplement how this book
Through the use of tantalizing questions and aptly chosen and often amusing examples, the author transmits to the reader the excitement and intellectual satisfaction of computer science research. Without the use of formal mathematics and without any sacrifice of intellectual integrity, he conveys to the general reader the profound principles on which computer science is founded and which hitherto were only accessible in abstruse and esoteric textbooks and papers. 
This is scientific writing at its best.
Oh goodness, it sure is scientific writing at its best: The charter of this blog—to host essays at the intersection of culture, software, technology, and science—is proud to share a book that is the culmination, and then some, of the ineffable confluence of software, technology, and science ๐Ÿ’ป ๐Ÿ“ฆ ๐Ÿ“ก

You should know upfront that Algorithmics has a story to tell. This ain't no cobweb-laced, put-you-to-sleep boat anchor that would sink you ⚓ Think of it as an adventure through the guts of computer science, with a strong emphasis, of course, on the concepts, ideas, methods and results that are fundamental to computer science. Also know that you won't get bogged down with formalisms, though they (i.e. formalisms) do have a rightful place; take this from someone smitten by the lambda calculus ๐Ÿ˜Ž

The subtitle—The Spirit of Computing—of Algorithmics is spot on because once you make your way through the pages of this remarkable book, you won't look at computers in quite the same way. You'll come away with kinship for the true spirit of computers: In other words, exactly what it is that make them tick (hint, hint: their algorithms) ⏰⌚

For those unfamiliar with the name David Harel, suffice it to say that he is a hugely influential individual in the firmament of theoretical computer science, being one of the leading researchers. He also happens to be the chairman of the Applied Mathematics and Computer Science Department at the renowned Weizmann Institute of Science ๐Ÿฐ

Think of Algorithmics as an endearing tour of theoretical computer science at the proverbial elevation of 50,000 feet, or is it 100,000 feet, or, heavens be praised, 10,000 feet, though that seems a bit too close to the ground for comfort? ๐Ÿš Anyhow, I think you got the idea, right? ๐Ÿ˜‰

Since we're talking about having a head for numbers, you might as well know that I'm incorrigibly bad at arithmetic, though pretty darned good at the logical layering and analysis—and synthesis, to be sure—which I use on a daily basis while going about my software design and development activities. Go figure!

The writing style of Algorithmics is truly exceptional; we have in Harel a master who is surveying his area of expertise with a magisterial command that reflects both his perspicacity and perspicuity. And believe it or not, it's written in a clear style that makes it suitable even for the layman—and laywoman, to be sure! I hastened to add the latter since I support egalitarian feminism, which you may have gathered from the quote atop this essay ๐Ÿ‘ฐ
You’ve Come a Long Way, Baby (Or Have You?) 
~ Ruth Rosen
The Rosen quote above, by the way, was aimed squarely at accentuating and amplifying the prior quote—in the context in which it had appeared, juxtaposed as it was with the following quote, atop this essay—where we heard a luminary of our field reminiscing about how
This was the first graph problem I ever posed myself and solved. The amazing thing was that I didn't publish it. It was not amazing at the time. At the time, algorithms were hardly considered a scientific topic (bold is mine) 
~ Edsger W. Dijkstra (as quoted by Dennis Shasha and Cathy Lazere in Out of their Minds: The Lives and Discoveries of 15 Great Computer Scientists (Copernicus))
To dig deeper still, I'd recommend a math textbook or two to accompany your study of Algorithmics—in and of itself, though, it's plenty good as a superb starting point ๐Ÿš€

And listen, to those who have objected to Algorithmics, saying that they returned this masterpiece because they demurred to the Biblical quotes that are tastefully sprinkled across its pages, all I have to say is this: Guys and gals, let's all of us please grow up ๐ŸŒ ๐ŸŒŽ ๐ŸŒ We're one global family, which is a point that brings me to the fourth of the four quotes that I had selected, after much deliberation, to adorn the outset of this essay:
I refuse to accept the view that mankind is so tragically bound to the starless midnight of racism and war that the bright daybreak of peace and brotherhood can never become a reality... I believe that unarmed truth and unconditional love will have the final word. 
~ Martin Luther King, Jr.
In sum, and in the words of Harel—the author of Algorithmics—from his preface to the book, we need to listen to an important story, and the fundamental premise that
This book tells a story. The story concerns the concepts, ideas, methods, and results
fundamental to computer science. It is not specifically about computer technology,
nor is it about computer programming, though obviously it is heavily influenced by
Many advanced textbooks do treat the fundamentals, but by their very nature they concentrate on specific topics, and do so at an advanced technical level that is usually unsuitable for the general reader. Even professional programmers and systems analysts might lack the background or motivation required to get through books aimed at full-time computer science students.  
Curiously, there appears to be very little written material devoted to the science of computing and aimed at the technically-oriented general reader as well as the computer professional. This fact is doubly curious in view of the abundance of precisely this kind of literature in most other scientific areas, such as physics, biology, chemistry, and mathematics, not to mention humanities and the arts. There appears to be an acute need for a technically-detailed, expository account of the fundamentals of computer science; one that suffers as little as possible from the bit/byte or semicolon syndromes and their derivatives, one that transcends the technological and linguistic whirlpool of specifics, and one that is useful both to a sophisticated layperson and to a computer expert. It seems that we have all been too busy with the revolution to be bothered with satisfying such a need.
If you come to Algorithmics with the following sort of idea, I can nearly guarantee that you won't be disappointed. Period.
Computer Science is no more about computers than astronomy is about telescopes.
Next up, we'll segue into an algorithmic twist on the beguiling world of functional programming, an area which—as long-time readers of my blog will attest to—was, and remains, near and dear to my heart ๐Ÿ’•

Two things to keep in mind as you read what I have to say here about Pearls of Functional Algorithm Design (Cambridge University Press) by Richard Bird. As a writer who's committed to serving his readers, I want to get my biases in front of you to let you make better and more informed choices as you go about your journeys of learning. In no particular order, please know that
  • I am intrigued by the promise of blending object-orientation (OOP) with functional programming (FP), as I've tried to articulate elsewhere ๐ŸŒน
  • I firmly believe that a programming language like Scala is well-positioned to serve as a bridge between the object-orientation of Java and the functional programming languages, as I've tried to demonstrate elsewhere ๐Ÿš 
  • I am in full agreement with Eric Raymond's assessment that the Lisp programming language—think Clojure, the Lisp-for-the-JVM programming language—is worth learning for the profound enlightenment experience you will have when you finally get it, as I've tried to explain elsewhere ๐Ÿ’ก
My biases in this area—and I think I got them all in front of you—inform and permeate my thinking and, in turn, will permeate the assessment of another gem of a book: Pearls of Functional Algorithm Design ☄

Seldom have I come across a book that was more appropriately named than this one; the reference to pearls is spot on, because this book is a gem in the rough. I seldom hear it mentioned in the programming community, which is a pity, because it has a ton to offer.

But first things first: All examples in Pearls of Functional Algorithm Design are presented in the Haskell programming language, which, by all admissions, is a pure functional programming language. If there is a programming language purer than Haskell, then I'm not aware of it. Then again, I'm decidedly not a language researcher or purist; for that sort of thing, you'll want to turn to someone like the esteemed Mark C. Chu-Carroll, PhD, author of a delightful book called Good Math (The Pragmatic Bookshelf). Chu-Carroll is—by any objective standard—an inveterate collector of programming  languages ๐Ÿš ๐Ÿš ๐Ÿš By his own delightfully candid admission in Good Math ๐Ÿ‘ป
In real life, I’m not a mathematician; I’m a computer scientist. I’m still a math geek, mind you, but what I really do is very much in the realm of applied math, working on building systems to help people build programs. One of my pathological obsessions is programming languages. Since I first got exposed to TRS-80 Model 1 BASIC back in middle school, I’ve been absolutely nuts about programming languages. Last time I counted, I’d learned about 150 different languages, and I’ve picked up more since then. I’ve written programs in most of them. Like I said, I’m nuts (italics mine).
As for me, my tastes are far more pragmatic, guided by my trusty compass that consists of the twin forces of taste and beauty. Yes Sir—and Gentle Lady—I'm a pragmatist to my core. Here's a telltale clue that will surely give everything away in this area: I think that the Scala programming language is the next best thing since sliced bread ๐Ÿž ๐Ÿž ๐Ÿž Yes, there is another JVM language in the shape of the lovely Lisp dialect that we know as the Clojure programming language; plus I've done plenty of dabbling in Clojure over the years. On top of that, we got lambdas added to the supple workhorse of a language that is Java when Java 8 appeared, yay! But there are only so many hours in a day to keep up with all the cool happenings in the JVM ecosystem, and elsewhere ⏳⏰⌛ Enough said.

Me, I'm more like Indiana Jones, if anyone remembers the intrepid archaeologist and adventurer from the classic movie Raiders of the Lost Ark—in which our nearly-fearless hero is hired by the U.S. government to find the Ark of the Covenant before the enemy does—constantly trying to unearth better ways of going about improving the art of programming, always on the lookout to uncover more intelligent approaches to crafting software, and perhaps trying to decipher the torrential fugues of design-related tactical paradigms in motion that swirl around in seemingly indecipherable patterns, unnervingly so at times. By the way, and lest there be any confusion, I hasten to point out that the preceding musings about software craftsmanship—and software craftswomanship, to be sure—which followed the trailing em-dash above was me speaking, not Professor Jones. Last time I checked, Professor Jones wasn't that much into software ๐Ÿ˜‰

Okay, so I'm not going to stretch that analogy too much, because it may not hold up for all I know lol. I will, though draw your attention briefly to an absolutely fantastic book—Surfaces and Essences: Analogy as the Fuel and Fire of Thinking (Basic Books) by Douglas Hofstadter and Emmanuel Sander—should you wish to digress and find out just how far analogies can take you on your intellectual journeys. Here, then, is a typical passage from the magisterial Surfaces and Essences in which the authors are telling a marvelous tale by retelling how
If we examine the pathway that Einstein took to reach the extended principle of equivalence (which applies to all phenomena of physics, not just to those of mechanics), we see that he re-exploited, in a new context, an analogy that he had already exploited once. More specifically, he carried out the same conceptual extension in two different contexts, each time starting with the concept of mechanical experiment and ending up with the more abstract concept of physical experiment... 
And Einstein used this analogical leap in two situations that were themselves analogous (first in extending the principle of Galilean relativity to yield special relativity, and later in extending the restricted principle of equivalence to yield the founding ideas of general relativity). 
Thus, the most advanced breakthrough of Einstein’s life came out of an analogical leap that was analogous to another analogical leap—thus an analogy between analogies, or, if you will, a meta-analogy. 
This recalls a remark once made by the Polish mathematician Stefan Banach, as recounted by his friend Stanislaw Ulam: "Good mathematicians see analogies between theorems or theories, but the very best ones see analogies between analogies." And along the same lines, Einstein’s Scottish predecessor James Clerk Maxwell once observed that rather than being attracted by parallels between different principles of physics, he was attracted by parallels between parallels, which would certainly seem to be the quintessence of abstraction (italics mine).
And trust me, there's no castle-building going on here; just plain old-fashioned abstract thinking, carved along the contours of what the amazing and legendary physicist Richard Feynman symbolized where his thinking style is on display—as memorably captured in the book entitled Smarter Than You Think: How Technology is Changing Our Minds for the Better (Penguin Press) by Clive Thompson ๐Ÿš‚

When historian Charles Weiner looked over a pile of Richard Feynman’s notebooks, he called them a wonderful 'record of his day-to-day work' to which Feynman demurred
"No, no!", Feynman objected strongly.
"They aren’t a record of my thinking process. They are my thinking process. I actually did the work on the paper."
"Well," Weiner said, "The work was done in your head, but the record of it is still here."
"No, it’s not a record, not really. It’s working. You have to work on paper and this is the paper. Okay?", Feynman explained.
Let's compile our computer programs in our head, shall we? Ready, set, go! It's Turing machines and lambda calculus all the way down—I kid you not ๐Ÿ˜‰

Feynman the Nobel laureate—he basically transformed the Physics department at Caltech into the powerhouse that it has remained ever since—truly understood that writing his equations and ideas on paper was crucial to his thought.

Let's now circle back to Pearls of Functional Algorithm Design and hear what Bird has to say about his motivation for putting together this pearly and lustrous book. In Bird's words
The idea they had in mind was to emulate the very successful series of essays that Jon Bentley had written in the 1980s under the title “Programming Pearls” in the Communications of the ACM. Bentley wrote about his pearls: 
Just as natural pearls grow from grains of sand that have irritated oysters, these programming pearls have grown from real problems that have irritated programmers. The programs are fun, and they teach important programming techniques and fundamental design principles. 
Equational reasoning dominates everything in this book. 
My interest has always been in algorithms and their design. Hence the title of this book is Pearls of Functional Algorithm Design rather than the more general Functional Pearls. Many, though by no means all, of the pearls start with a specification in Haskell and then go on to calculate a more efficient version. 
My aim in writing these particular pearls is to see to what extent algorithm design can be cast in a familiar mathematical tradition of calculating a result by using well-established mathematical principles, theorems and laws. While it is generally true in mathematics that calculations are designed to simplify complicated things, in algorithm design it is usually the other way around: simple but inefficient programs are transformed into more efficient versions that can be completely opaque. It is not the final program that is the pearl; rather it is the calculation that yields it. 
Other pearls, some of which contain very few calculations, are devoted to trying to give simple explanations of some interesting and subtle algorithms. Explaining the ideas behind an algorithm is so much easier in a functional style than in a procedural one: the constituent functions can be more easily separated, they are brief and they capture powerful patterns of computation.
To give you a tantalizing view of the pearls that await you in this oyster, consider its delectable offering by way of the table of content:
Preface page ix
1 The smallest free number 1
2 A surpassing problem 7
3 Improving on saddleback search 12
4 A selection problem 21
5 Sorting pairwise sums 27
6 Making a century 33
7 Building a tree with minimum height 41
8 Unravelling greedy algorithms 50
9 Finding celebrities 56
10 Removing duplicates 64
11 Not the maximum segment sum 73
12 Ranking suffixes 79
13 The Burrows–Wheeler transform 91
14 The last tail 102
15 All the common prefixes 112
16 The Boyer–Moore algorithm 117
17 The Knuth–Morris–Pratt algorithm 127
18 Planning solves the Rush Hour problem 136
19 A simple Sudoku solver 147
20 The Countdown problem 156
21 Hylomorphisms and nexuses 168
22 Three ways of computing determinants 180
23 Inside the convex hull 188
24 Rational arithmetic coding 198
25 Integer arithmetic coding 208
26 The Schorr–Waite algorithm 221
27 Orderly insertion 231
28 Loopless functional algorithms 242
29 The Johnson–Trotter algorithm 251
30 Spider spinning for dummies
Is that an awesome menu, um, table of contents I meant to say, or what? ๐Ÿช ๐Ÿฉ ๐Ÿฎ ๐Ÿ‘œ ๐Ÿ‘ ⛱

Look, ssshhhh, let's digress just a tad, and nobody will be the wiser ๐Ÿ˜ด๐Ÿ˜ฒ

And it's not that egregious of a digression anyway, since I happened to have noted above that all examples in Pearls of Functional Algorithm Design are presented in the Haskell programming language—so let's listen to what Guy Steele has to say about Haskell. As longtime readers of my blog know, Steele is one of my programming heroes; he is widely regarded as the father of Common Lisp; and he happens to be the lead author of the Java Language Specification. This is what Steele had to say in one of Seibel's interviews in the sparkling-with-insights book entitled Coders at Work in connection with Haskell:
Haskell is a beautiful language. I love Haskell. I don't use it that much... On the other hand, now Haskell has discovered monads and they have dragged in the I/O monad and now the transactional-memory monad. There's a theory that it's functional and maybe that does give you a leg up. 
On the other hand it's feeling more and more imperative. And I can't resist thinking of the White Knight in Through the Looking Glass—"I was thinking of a plan to dye one's whiskers green, and always use so large a fan that they could not be seen." And in some ways, monads strike me as that fan, where you're dragging in the I/O and trying to hide it again—are the side effects really there, or are they really not? ☕ ๐Ÿฑ ☕
Just remember: This digression will be our secret, okay, and we'll be all good? ๐Ÿ˜‡

Now, to illustrate the flow of the narratives in Pearls of Functional Algorithm Design, let's take, as an example, the delightful third chapter, which is prosaically entitled Improving on Saddleback Search. The setting is a classroom tutorial on functional algorithm design. There are four students: Anne, Jack, Mary and Theo and we proceed like so, Socratic dialog and all, with the Teacher going first ๐ŸŽ“
Teacher: Good morning class. Today I would like you to design a function invert that takes two arguments: a function f from pairs of natural numbers to natural numbers, and a natural number z. The value invert f z is a list of all pairs (x , y) satisfying f (x , y) = z . You can assume that f is strictly increasing in each argument, but nothing else. 
Jack: That seems an easy problem. Since f is a function on naturals and is increasing in each argument, we know that f (x , y) = z implies x ≤ z and y ≤ z . Hence we can define invert by a simple search of all possible pairs of values: 
invert f z = [(x , y) | x ←[0 .. z ], y ←[0 .. z ], f (x , y) z ] 
Doesn’t this solve the problem? 
Teacher: Yes it does, but your solution involves (z + 1)2 evaluations of f . Since f may be very expensive to compute, I would like a solution with as few evaluations of f as possible. 
Theo: Well, it is easy to halve the evaluations. Since f (x , y) ≥ x +y if f is increasing, the search can be confined to values on or below the diagonal of the square: 
invert f z = [(x , y) | x ←[0 .. z ], y ←[0 .. z − x ], f (x , y) z ] 
Come to think of it, you can replace the two upper bounds by z − f (0, 0) and z − x − f (0, 0). Then if z < f (0, 0) the search terminates at once.
Ah yes, charming Socratic dialog and all, with some glimmers, dare I say, of the scintillating magnum opus of a landmark book that many of us affectionately call GEB—for the initials in Gรถdel, Escher, Bach: An Eternal Golden Braid—by the Pulitzer Prize-winning author Douglas Hofstadter. Remember how we were regaled in GEB with mind-bending dialogs between crabs and ants and stuff? ๐ŸŒ ๐Ÿœ ๐ŸŠ ๐Ÿ ๐Ÿš

Well, back to Pearls of Functional Algorithm Design, allow me to ask: Were you starting to think thoughts such as the following? Groan, a tome with strong functional programming undercurrents—surely we need to brace ourselves for a deadly boring treatise? So let me comfort you by saying, Trust me on this one; not a trace of boredom anywhere in sight with this gem. What you'll be in for is a delightfully pleasant surprise of discovering algorithmic excellence from the functional point of view ๐ŸŽˆ

This book will, as it were, grab your imagination and whisk you away to Neverland, in the fabulous tradition of Peter Pan ๐ŸŒˆ Here are other candid thoughts that I jotted down earlier during recent transcontinental transit—I wrote the bulk of this essay while flying from Austin to San Diego. Hmm... That might explain the the flight of fantasy with which we had a brief skirmish above. Some other thoughts are as follows ๐ŸŒน

You will see the elegant mathematical machinery neatly unpacked and put together again—something that Humpty Dumpty failed at after he had had a great fall from the wall—to see exactly what it is that makes an intricate (functional) algorithm  tick. Remember, too, how four-score men and four-score more, could not make Humpty Dumpty where he was before, alas ๐Ÿ“ But hey, that was then, and this is now ๐ŸŽ‰

Fear not, though, intrepid reader! The mathematical machinery—which ably accompanies the narratives in Pearls of Functional Algorithm Design to marvelous effect—is both packed and neatly unpacked without a hitch, whew. And yes, Bird pulls no punches; yet he neither talks down condescendingly nor resorts to hand waving nor dumbs things down. This book hit the sweet spot for me ๐Ÿฏ It's simply marvelous in a delicious way.

The presentation is pleasing, broken down into digestible chunks: aptly annotated code snippets, helpful tables, elegant mathematical underpinnings that have neatly been drawn into a cohesive narrative. Pearls of Functional Algorithm Design is, alas, sorely lacking in the illustrations department. This was a bit of a letdown for visually oriented designers and programmers like me—should you wish to see everything that a book can be, firing on all cylinders, as it were, look no further than the tour de force entitled The Nature of Computation (Oxford University Press) by Cristopher Moore and Stephan Mertens, on which I have lavished much attention elsewhere, in the first installment of this series of essays, in fact ๐ŸŒฟ

While The Nature of Computation did not come in at the first spot—I valiantly resisted putting it in the first spot, sorely tempted though I was—simply because I would be doing a disservice to my readers by pointing them in the direction of a book that, awesome as it is, is not an introductory one. Think classical utilitarianism ala Jeremy Bentham and John Stuart Mill who held that we ought to maximize the good, that is, bring about "the greatest amount of good for the greatest number".

The pearls in this book—the brute force algorithms—are progressively rewritten into their increasingly efficient counterpart algorithms. The way this is all wrought, the manner in which the intermediate steps are crafted, is something to behold, and I really shouldn't take away your excitement prematurely, oh no ๐Ÿ”ฆ

Dig in, and you'll see what I'm talking about. As a prelude, you may also wish to look at precisely this sort of transformational craftsmanship on glorious display—albeit from the distinctly different yet equally venerable object-oriented perspective—in the astonishingly good book Refactoring to Patterns by Joshua Kerievsky (Addison-Wesley Professional) as I've tried to capture in an essay elsewhere ๐ŸŽ ๐Ÿฐ

This is a book for someone who likes to think. If that's you, don't miss Pearls of Functional Algorithm Design ๐Ÿ’

Next up, we have a book that's drenched in a remarkably creative approach to teaching algorithms: How to Think About Algorithms (Cambridge University Press) by Jeff Edmonds. I have not seen a book quite like this—on the subject of algorithms or otherwise—anywhere else!

People that I've talked to have referred to How to Think About Algorithm as a life changer. What many have—myself prominently included—appreciated a lot about this book's approach is its uncompromising devotion to studying a number of well-known algorithms that solve important problems, presenting the associated pitfalls, going over several ways to solve the problem at hand, even when intuition contradicts reality, and finally explaining the correct solution ๐Ÿ’ฏ

The author, Edmonds, capture the gestalt of this book rather nicely in the highly detailed preface to the book by breaking up his recommendations to studying How to Think About Algorithm into easily digestible chunks, grouped under headings like the following, beginning with
Meta-Algorithms: Students must learn so many algorithms that they are sometimes overwhelmed. In order to facilitate their understanding, most textbooks cover the standard themes of iterative algorithms, recursion, greedy algorithms, and dynamic programming. Generally, however, when it comes to presenting the algorithms themselves and their proofs of correctness, the concepts are hidden within optimized code and slick proofs. One goal of this book is to present a uniform and clean way of thinking about algorithms. We do this by focusing on the structure and proof of correctness of iterative and recursive meta-algorithms, and within these the greedy and dynamic programming meta-algorithms. By learning these and their proofs of correctness, most actual algorithms can be easily understood. The challenge is that thinking about meta-algorithms requires a great deal of abstract thinking. 
Abstract Thinking: Students are very good at learning how to apply a concrete code to a concrete input instance. They tend, however, to find it difficult to think abstractly about the algorithms. I maintain that the more abstractions a person has from which to view the problem, the deeper his understanding of it will be, the more tools he will have at his disposal, and the better prepared he will be to design his own innovative ways to solve new problems. Hence, I present a number of different notations, analogies, and paradigms within which to develop and to think about algorithms. 
Dreaming: I would like to emphasis the importance of thinking, even daydreaming, about the material. This can be done while going through your day – while swimming, showering, cooking, or lying in bed. Ask questions. Why is it done this way and not that way? Invent other algorithms for solving a problem. Then look for input instances for which your algorithm gives the wrong answer. Mathematics is not all linear thinking. If the essence of the material, what the questions are really asking, is allowed to seep down into your subconscious then with time little thoughts will begin to percolate up. Pursue these ideas. Sometimes even flashes of inspiration appear.
Did anyone catch that, Dreaming? Here's the deal: Another book—The Nature of Computation—is precisely what I have in mind here. In fact, I had elaborated a bit on this theme in an essay elsewhere, where I had shared with you the following thought, noting how
Algorithms, more than anything else in the entire fabric of computer science, IMHO, evolve and thrive in the hotbed of creativity, and who better to illustrate this with than the true legend of Kekulรฉ, who saw in a dream a snake eating its own tail, and which led Kekule—upon awaking from his dream—to the monumental discovery of the benzene molecule's structure ๐Ÿ
Fancy that, I'm caught quoting myself in a virtual act of self-referential circularity; goodness, maybe next we'll be contemplating Salvador Dali's melting watches and stuff ⏰⏳⌛๐ŸŽ

This book is a creative whack on the side of one's head. To illustrate this point, lest you think that I'm engaging in psychobabble, consider this typical piece of advice from the pages of How to Think About Algorithm—and this fine book is liberally sprinkled with such similar nuggets of wisdom—on how to use the metaphor of analogy as a guide. Thus, Edmonds cogently advises us to
Worry about one step at a time. Don’t get pulled into the strong desire to understand the entire computation at once. Generally, this only brings fear and unhappiness. I repeat the wisdom taught by both the Buddhists and the twelve-step programs: Today you may feel like like you were dropped off in a strange city without knowing how you got there. Do not worry about the past or the future. Be reassured that you are somewhere along the correct road. Your goal is only to take one step so that you make progress and stay on the road. Another analogy is to imagine you are part of a relay race. A teammate hands you the baton. Your job is only to carry it once around the track and hand it to the next teammate (italics mine).
Did that grab your interest? It sure grabbed mine when I first read How to Think About Algorithms, ages ago, since which time I've revisited its pages many times over ๐ŸŽป I believe that How to Think About Algorithm will make an awesome second book on algorithms; it may be a bit much to digest as your very first introduction to the exciting world of algorithms.


Last, but certainly not the least, is another remarkable book on algorithms: Algorithms Unplugged (Springer) by Berthold Vรถcking et al. Don't overlook this cool book or let its seeming simplicity put you off; true, a non-computer science individual could, with some effort, pick it up and run with it, without running into too much difficulty in understanding how algorithms work ๐ŸŽฏ

I'm not aware of a kinder, gentler approach to introducing yourself to the study of algorithms. For example, consider this typical piece of guidance, all of it gently carved into easily digestible, yet solidly intelligent chunks—Here, Heribert Vollmer and Dorothea Wagner (both are among the contributors to this nicely eclectic book) are giving an overview of Optimization in Part IV of the book. They remind us how
For many other important optimization problems no efficient solution algorithm is known to this day. The only way to find the optimal solution is to compare all possible solutions. The time requirement for this simple procedure is of course dependent on the number of solutions and hence in general it is very large. For example, in Chap. 39 a knapsack has to be packed optimally for a hike, but there are many different ways to use its capacity. Also the above problem to determine the shortest round-trip through a number of cities is one of the hard problems for which we do not know how to find an optimal solution. But in Chap. 40 we will see how a so-called approximation algorithm finds a tour that is maybe not the shortest one but one whose length usually is quite close to the optimum; in the worst case it is twice as long. The final chapter of this book, Chap. 41, introduces simulated annealing, an algorithmic method that produces approximate solutions for a number of optimization problems with certain mathematical properties. The name of this magical method is due to an analogy with an industrial technique that involves the heating and controlled cooling "annealing") of a material to improve its stability (italics mine).
Finally, in an act of virtual self-recursion—with a vigorous nod to the adage that imitation is the sincerest form of flattery—I am pilfering a paragraph from my first installment of this essay and reminding us all that ☕
There is a lot going on in this excellent book, far more than I can do justice to at this juncture. Suffice it to say that I'm becoming increasingly and acutely aware of a startling phrase—at least that's how the phrase grabbed me on my first encounter with it—that "Real Artists Ship". There, in his bestseller entitled Linchpin: Are You Indispensable? (p.101), Seth Godin was reminding us of the importance that shipping a product must occupy in our collective consciousness ๐Ÿšš
So it is that I will now exit, but not before an admittedly flamboyant flourish that harkens back to the 1937 Disney classic, Snow White and the Seven Dwarfs, in which the Evil Queen utters the famous line that I'm here taking the liberty of wildly paraphrasing—with a nod to Godin's moniker that "Real Artists Ship"—by intoning
Magic mirror, on the wall—which one is the fastest shipping method of them all?
๐Ÿš‚ ๐Ÿšƒ ๐Ÿšš ๐Ÿšข ๐Ÿš…
In the end—and much as I hinted at, at the outset—I invite your comments. Equally importantly, please, do please consider helping our fellow Americans who are bracing themselves for the fury of Hurricane Irma.

I'll mention this as a friendly reminder—your comments are welcomed, as always—that having read my brief take each on a handful of the finest algorithms books...
  • Did you find that your experience of reading these books was perhaps different? 
  • Were there other qualities, perhaps, that I did not cover, and which happen to be the ones that you found the more helpful—in these or other books—as you mastered algorithms? 
  • Did I leave out any of your favorite algorithms books?! 
  • I've covered only a tiny fraction of the algorithms books that I've read, necessarily limited by the time available—stay tuned for future installments of this essay 
I trust that these brief vignettes will help you in some small way along your journey to grokking algorithms ๐Ÿšฃ And yay, we made it through a whole essay without my digressing much—now fancy that. And now that we're done with the, ahem, essay proper, however, we surely can digress a tad, can't we? ๐Ÿ˜‚

Woohoo, here we go ⛷

See, didn't I tell you that while I may be recalcitrant at times, when it comes to digressingI try to do so with often a method to my madnessI'm hopefully not that incorrigible, and people who know me hardly think of me as a curmudgeon ๐Ÿ˜‡

With that, I rest my case; now you tell me if I made good on my promise that —unlike the previous installment where digressions were center squaredigressions were going to appear only after the essay proper ๐Ÿ

In the end, and in no particular order, here then is a fine set of yet other books on algorithmsand data structures, to be sure—which I had in mind when I sat down to scribble some musings on the subject of algorithms, a subject that ever remains near and dear to my heart ๐Ÿ’
What is this thing that builds our dreams, yet slips away from us. 
Forever is our today, 
Who wants to live forever, 
Who wants to live forever, 
Forever is our today, 
Who waits forever anyway? 
~ Queen (Lyrics from Who Wants To Live Forever)
In a properly automated and educated world, then, machines may prove to be the true humanizing influence. It may be that machines will do the work that makes life possible and that human beings will do all the other things that make life pleasant and worthwhile. 
~ Isaac Asimov, Robot Visions
For God’s sake, let us be men, not monkeys minding machines, or sitting with our tails curled while the machine amuses us, the radio or film or gramophone. Monkeys with a bland grin on our faces.
~ D.H. Lawrence, Selected Letters
If you plan on being anything less than you are capable of being, you will probably be unhappy all the days of your life.
~ Abraham Maslow
The art of the bird is to conceal its nest both as to position and as to material, but now and then it is betrayed into weaving into its structure showy and bizarre bits of this or that, which give its secret away and which seem to violate all the traditions of its kind. 
~ John Burroughs
I've got the key to my castle in the air, but whether I can unlock the door remains to be seen. 
~ Louisa May Alcott, Little Women
Humanity has the stars in its future, and that future is too important to be lost under the burden of juvenile folly and ignorant superstition. 
~ Isaac Asimov
And then there was the classic among classics: Tracy Kidder's unprecedented tour de force 
The Soul of a New Machine that was quite the publishing event, and which won a well-deserved Pulitzer Prize, notwithstanding the oh-so-endearing malapropism it engendered ๐Ÿฃ


  1. - As the author of this blog, I—as a matter of principle—do not edit my essays after posting them; I will, on occasion, revisit and clean up grammatical mistakes, or perhaps add links, update stale links, but that's about it.

    - Having said that, I wished to share some thoughts that are directly related to this post, and which had got inadvertently left out when I wrapped up and posted this essay a few days ago...

    - First, though, I recently received feedback from readers that a lighter-still background for this blog would make it easier on their eyes. As always, I take every bit of feedback seriously in order to make the reading experience around here ever-improving for us all :)

    - As I take that feedback into account, I wish to ask: Before the recent makeover of this site, the background theme of the blog was quite a bit darker, but if an even more lighter background theme is preferrable, I’ll look into that and make necessary updates, for sure! Thoughts? Please keep sharing your thoughts, and let's us all make this the best blog site ever!

    - Here, then, are thoughts that are directly related to this post, and which had got inadvertently left out:

    [1] Did I make good on the promise that I had made in saying?:

    "Rest assured that, this time around anyway—unlike the previous installment where digressions were center square—digressions will appear only after the essay proper".

    [2] I shared the table of contents (TOC) for a couple of the books reviewed; was that a help or a redundancy or, worse still, a hindrance? :(

    [3] My coverage of the algorithms books—it least as measured by the amount of description that I devoted to each book—was admittedly lopsided. Is that OK, or would you like for the coverage of the books I review in the future be more even (in terms of the amount of description)?

    [4] Last, but certainly NOT the least: I invite you all to please NOT by shy. Please contribute away through your comments. Highly encouraged :)

    [5] This is YOUR blog as much as it's mine: I not only write stuff to share with you, I also come back and actually read what I've written, if only to refresh myself on what perspective(s) I had, and shared, at any given time. Our understanding—both individually and collectively—is IMHO constantly evolving and growing...

  2. Thank you for the very enjoyable part 2 on Algorithms :)

    I liked how in this essay you disclosed a little on your reading methodology (highlighter, tabs etc). I would like to ask more about your methodology, do you read similar sections from each book at the same time ? How do you make effective notes ?

    Some other questions I would like to ask are ;

    What do you think of books such as Cracking the coding interview or Elements of programming interviews ? They aim to teach algorithms in a way to solve problems for interview tests etc ? They are also suppose to be a little easier for newcomers

    Also what are your thoughts on practising algorithmic skills by solving problems on popular websites such as leetcode , hackerrank ?

    For someone that hasn't touched any math since their CS degree, what areas of maths would you say are most important to go other before tackling algorithms ? Would you recommend learning the math as going along or are there any must have pre-cursor topics ?

    Keep up to great work, Thanks

    1. - Thank you, Shahbaaz, for sharing how you enjoyed this essay, Part 2 of Algorithms! I'm delighted that you found it enjoyable

      - What more can a technologist and writer ask for than be accepted and appreciated by their readers :)

      - Let's quickly talk about the next installment in this series of essays—yes, I'm now getting a Part 3 of Algorithms into the production pipeline (for this blog) even as I write this response. And what a coincidence it is that got me thinking of doing an essay for Part 3 of Algorithms...

      - A handful of additional algorithms books—which prominently includes one of the two you mention, Elements of Programming Interviews by Adnan Aziz et al—were already brewing in my mind, for inclusion in a future installment in this blog series. After reading your comment, I'm convinced that you as well as other readers would benefit from a conversation on those algorithms books, too. A little bird tells me to tell you all: Stay tuned for a future essay :)

      - Okay, now to your questions, because I read and give serious thought to every single comment from readers... As to your first comment-and-question ("I liked how in this essay you disclosed a little on your reading methodology (highlighter, tabs etc). I would like to ask more about your methodology, do you read similar sections from each book at the same time? How do you make effective notes?"), let me begin my response by saying that I firmly believe in the philosophy of progressive disclosure, which has guided me well in my career and personal lives, both. Okay, Akram, stop philosophizing already lol ;)

      - So here's the deal: Yes, to sift through the mountains of information that we technologists face every single day—other professionals probably do as well, though perhaps not with the same intensity and sheer volume—we absolutely need a reading methodology to get anywhere with the deluge of information... The times for a stochastic approach are long gone, though probabalistic thinking, albeit in a tangential way, is positively in, and in a big way: So in the spirit of full disclosure, I'll confess that an essay on Deep Learning is in the production pipeline for this blog... Stay tuned.

      - The best way I know of to conquer (seemingly) difficult material is best captured in a really cool (top secret) book to which I'll share a pointer here: Check out How to Win at College: Surprising Secrets for Success from the Country's Top Students by Cal Newport. Via the preceding link, go to the section for Cal Newport (who I ranked in the top spot) and in particular go to the aforementioned book and find Chapter 70 (Study with the Quiz-and-Recall Method), which contains the following stellar piece of advice:

      "You should build your entire approach to studying around the concept that making yourself recall specific information is the absolute best way to learn".

    2. - So I'm a computer scientist who has been practicing the fine art of programming for over two decades. So I would also point you in the direction of the wise words of Edward B. Burger (Southwestern University, Georgetown/Texas) and Michael Starbird (The University of Texas at Austin) who note in their slender yet rich book entitled The 5 Elements of Effective Thinking (Princeton University Press) that:

      "Understand simple things deeply. The most fundamental ideas in any subject can be understood with ever-increasing depth. Professional tennis players watch the ball; mathematicians understand a nuanced notion of number; successful students continue to improve their mastery of the concepts from previous chapters and courses as they move toward the more advanced material on the horizon; successful people regularly focus on the core purpose of their profession or life. True experts continually deepen their mastery of the basics".

      - If I were put on the spot and persuaded—let's here remind ourselves of the delicate yet pragmatic distinction that Winston Churchill drew between the related concepts of "persuading" and "convincing"—to divulge one secret that I guard with my life, that would be it, what I shared above by way of the memorable words from the slender yet deep book entitled The 5 Elements of Effective Thinking (Princeton University Press)

      - I should divulge that I've always been endearingly impressed by the onion-layers-of-conceptualizing metaphor as well as the undertones of constantly revisiting the basics for ever-increasingly faithful conceptualizations. I trace this to my undergrad years when I spent countless hours poring over the mesmerizing pages of the classic MIT textbook, Circuits, Signals, and Systems by William M. Siebert. More details on background can be found here...

      - As to your second question ("What do you think of books such as Cracking the Coding Interview or Elements of Programming Interviews? They aim to teach algorithms in a way to solve problems for interview tests etc? They are also supposed to be a little easier for newcomers...")—which is truly an awesome question BTW—I would say that books in this genre fill an essential gap left by textbooks, such as those that we've seen so far in this series of essays, i.e. Part 1 and Part 2 of Algorithms... These books are indispensable in helping you bridge the gap to landing a great technology job, so there you go.

      - And frankly, one of the two books that you mention, Elements of Programming Interviews by Adnan Aziz et al., is worthy of studying as a classic in its own right. Programming interview prep notwithstanding, it's a fantastic resource of distilled wisdom on all things algorithms, and one that you don't want to miss. Stay tuned for (much) more on it in the next installment in this series of essays—Part 3 of Algorithms :)

    3. - Moving on now to your third question ("Also what are your thoughts on practising algorithmic skills by solving problems on popular websites such as leetcode, hackerrank?"), I've got to confess that I'm not familiar with either one of the problem solving popular websites that you mention—now more than ever, I rely on my readers to keep me educated!

      - Okay, so I'm not completely ignorant either, at least I hope not lol ;)

      - With the disclaimer above, let me to point you to two resources, the former being directly related to helping answer your question, and the latter a bit tangentially so. But hey, then again, we're cruising around here on a blog known as Programming Digressions, where a diverse group of readers gathers and shares all
      kinds of interesting ideas at the intersection of culture, software, technology, and science, right?:

      (1) Design Algorithmic Solutions on Project Euler
      (2) Reddit links to a diverse set of related topics...

      - Finally, moving on now to your fourth question ("For someone that hasn't touched any math since their CS degree, what areas of maths would you say are most important to go other before tackling algorithms? Would you recommend learning the math as going along or are there any must have precursor topics?"), which is an awesome question since it got me thinking, so thanks for asking! I say so because I remain smitten, as ever, by trying to find better ways of wielding the power of mathematics that we, as software designers, can bring to bear on our design and craftsmanship work, every single day.

      - I'll have a lot more to say about this, it just so happens, in an upcoming essay on Deep Learning. Meanwhile, suffice it to say that, speaking of the relevance and pervasiveness of math throughout the fabric of science—in particular the math-oriented areas of computer science like deep learning—I can't help but draw parallels to, and resonate with, the marvelously erudite and approachable essay by the Hungarian-American theoretical physicist, engineer, and mathematician Eugene Wigner. It's entitled The Unreasonable Effectiveness of Mathematics in the Natural Sciences. Don't miss it. Again, stay tuned for more in a future essay :)

      - So I would draw your attention purposely to Discrete Math and Linear Algebra especially; lots more to follow in a future essay...

      - Last, but certainly not the least, I gratefully acknowledge your gracious words when you say Keep up to great work! Please know that I don't write in a vacuum; I write for my readers, so please you and all, do continue sharing your thoughts—Readers like you make my day, every day, giving me a sense of purpose to continue writing. Let's not let a good thing come to an end :)