Close Modal

The Recursive Book of Recursion

Ace the Coding Interview with Python and JavaScript

Look inside
Paperback
$39.99 US
7"W x 9.25"H x 0.75"D   (17.8 x 23.5 x 1.9 cm) | 22 oz (612 g) | 22 per carton
On sale Aug 16, 2022 | 328 Pages | 9781718502024
Sales rights: World
An accessible yet rigorous crash course on recursive programming using Python and JavaScript examples.

Recursion has an intimidating reputation: it’s considered to be an advanced computer science topic frequently brought up in coding interviews. But there’s nothing magical about recursion.
 
The Recursive Book of Recursion uses Python and JavaScript examples to teach the basics of recursion, exposing the ways that it’s often poorly taught and clarifying the fundamental principles of all recursive algorithms. You’ll learn when to use recursive functions (and, most importantly, when not to use them), how to implement the classic recursive algorithms often brought up in job interviews, and how recursive techniques can help solve countless problems involving tree traversal, combinatorics, and other tricky topics.
 
This project-based guide contains complete, runnable programs to help you learn:
 
  • How recursive functions make use of the call stack, a critical data structure almost never discussed in lessons on recursion
  • How the head-tail and “leap of faith” techniques can simplify writing recursive functions
  • How to use recursion to write custom search scripts for your filesystem, draw fractal art, create mazes, and more
  • How optimization and memoization make recursive algorithms more efficient
  •  
    Al Sweigart has built a career explaining programming concepts in a fun, approachable manner. If you’ve shied away from learning recursion but want to add this technique to your programming toolkit, or if you’re racing to prepare for your next job interview, this book is for you.
    "This book takes the mystery out of recursion. By the time you finish it, you'll see recursion as a powerful technique, but also a technique usable by mere mortals."
    —John D. Cook

    "... this book is a worthy read for a developer who wants to deepen their knowledge of advanced programming topics. While basic recursion is included in early programming curriculum, it typically stops at examples that can be reproduced with iteration. In this book, Al Sweigart starts are these basics and quickly expands to include types of algorithms that benefit from recursion, such as tree traversal and divide-and-conquer. Though focused on those actively interviewing for engineering roles, the book is also a good fit for professional development, an engineering book club, or a brain tickler for your technical book shelf. The real life projects at the end are especially informative, which is why I think... (this review 'recurs' to the beginning)"
    —Adam DuVander, @adamd, Founder of EveryDeveloper

    "I have felt for a long time that I had a pretty good handle on the subject of recursion . . . Thanks to Al Sweigart's new book, I think I'm far better informed than I was before. I will re-read this book a couple more times, just to add to the knowledge."
    —Ronnie Tucker, Editor, Full Circle Magazine
    Al Sweigart is a software developer and tech book author living in Houston. Python is his favorite programming language, and he is the developer of several open source modules for it. His other books are freely available under a Creative Commons license on his website at https://www.inventwithpython.com/.
    Available for sale exclusive:
    •     Afghanistan
    •     Aland Islands
    •     Albania
    •     Algeria
    •     Andorra
    •     Angola
    •     Anguilla
    •     Antarctica
    •     Antigua/Barbuda
    •     Argentina
    •     Armenia
    •     Aruba
    •     Australia
    •     Austria
    •     Azerbaijan
    •     Bahamas
    •     Bahrain
    •     Bangladesh
    •     Barbados
    •     Belarus
    •     Belgium
    •     Belize
    •     Benin
    •     Bermuda
    •     Bhutan
    •     Bolivia
    •     Bonaire, Saba
    •     Bosnia Herzeg.
    •     Botswana
    •     Bouvet Island
    •     Brazil
    •     Brit.Ind.Oc.Ter
    •     Brit.Virgin Is.
    •     Brunei
    •     Bulgaria
    •     Burkina Faso
    •     Burundi
    •     Cambodia
    •     Cameroon
    •     Canada
    •     Cape Verde
    •     Cayman Islands
    •     Centr.Afr.Rep.
    •     Chad
    •     Chile
    •     China
    •     Christmas Islnd
    •     Cocos Islands
    •     Colombia
    •     Comoro Is.
    •     Congo
    •     Cook Islands
    •     Costa Rica
    •     Croatia
    •     Cuba
    •     Curacao
    •     Cyprus
    •     Czech Republic
    •     Dem. Rep. Congo
    •     Denmark
    •     Djibouti
    •     Dominica
    •     Dominican Rep.
    •     Ecuador
    •     Egypt
    •     El Salvador
    •     Equatorial Gui.
    •     Eritrea
    •     Estonia
    •     Ethiopia
    •     Falkland Islnds
    •     Faroe Islands
    •     Fiji
    •     Finland
    •     France
    •     Fren.Polynesia
    •     French Guinea
    •     Gabon
    •     Gambia
    •     Georgia
    •     Germany
    •     Ghana
    •     Gibraltar
    •     Greece
    •     Greenland
    •     Grenada
    •     Guadeloupe
    •     Guam
    •     Guatemala
    •     Guernsey
    •     Guinea Republic
    •     Guinea-Bissau
    •     Guyana
    •     Haiti
    •     Heard/McDon.Isl
    •     Honduras
    •     Hong Kong
    •     Hungary
    •     Iceland
    •     India
    •     Indonesia
    •     Iran
    •     Iraq
    •     Ireland
    •     Isle of Man
    •     Israel
    •     Italy
    •     Ivory Coast
    •     Jamaica
    •     Japan
    •     Jersey
    •     Jordan
    •     Kazakhstan
    •     Kenya
    •     Kiribati
    •     Kuwait
    •     Kyrgyzstan
    •     Laos
    •     Latvia
    •     Lebanon
    •     Lesotho
    •     Liberia
    •     Libya
    •     Liechtenstein
    •     Lithuania
    •     Luxembourg
    •     Macau
    •     Macedonia
    •     Madagascar
    •     Malawi
    •     Malaysia
    •     Maldives
    •     Mali
    •     Malta
    •     Marshall island
    •     Martinique
    •     Mauritania
    •     Mauritius
    •     Mayotte
    •     Mexico
    •     Micronesia
    •     Minor Outl.Ins.
    •     Moldavia
    •     Monaco
    •     Mongolia
    •     Montenegro
    •     Montserrat
    •     Morocco
    •     Mozambique
    •     Myanmar
    •     Namibia
    •     Nauru
    •     Nepal
    •     Netherlands
    •     New Caledonia
    •     New Zealand
    •     Nicaragua
    •     Niger
    •     Nigeria
    •     Niue
    •     Norfolk Island
    •     North Korea
    •     North Mariana
    •     Norway
    •     Oman
    •     Pakistan
    •     Palau
    •     Palestinian Ter
    •     Panama
    •     PapuaNewGuinea
    •     Paraguay
    •     Peru
    •     Philippines
    •     Pitcairn Islnds
    •     Poland
    •     Portugal
    •     Puerto Rico
    •     Qatar
    •     Reunion Island
    •     Romania
    •     Russian Fed.
    •     Rwanda
    •     S. Sandwich Ins
    •     Saint Martin
    •     Samoa,American
    •     San Marino
    •     SaoTome Princip
    •     Saudi Arabia
    •     Senegal
    •     Serbia
    •     Seychelles
    •     Sierra Leone
    •     Singapore
    •     Sint Maarten
    •     Slovakia
    •     Slovenia
    •     Solomon Islands
    •     Somalia
    •     South Africa
    •     South Korea
    •     South Sudan
    •     Spain
    •     Sri Lanka
    •     St Barthelemy
    •     St. Helena
    •     St. Lucia
    •     St. Vincent
    •     St.Chr.,Nevis
    •     St.Pier,Miquel.
    •     Sth Terr. Franc
    •     Sudan
    •     Suriname
    •     Svalbard
    •     Swaziland
    •     Sweden
    •     Switzerland
    •     Syria
    •     Tadschikistan
    •     Taiwan
    •     Tanzania
    •     Thailand
    •     Timor-Leste
    •     Togo
    •     Tokelau Islands
    •     Tonga
    •     Trinidad,Tobago
    •     Tunisia
    •     Turkey
    •     Turkmenistan
    •     Turks&Caicos Is
    •     Tuvalu
    •     US Virgin Is.
    •     USA
    •     Uganda
    •     Ukraine
    •     Unit.Arab Emir.
    •     United Kingdom
    •     Uruguay
    •     Uzbekistan
    •     Vanuatu
    •     Vatican City
    •     Venezuela
    •     Vietnam
    •     Wallis,Futuna
    •     West Saharan
    •     Western Samoa
    •     Yemen
    •     Zambia
    •     Zimbabwe

    About

    An accessible yet rigorous crash course on recursive programming using Python and JavaScript examples.

    Recursion has an intimidating reputation: it’s considered to be an advanced computer science topic frequently brought up in coding interviews. But there’s nothing magical about recursion.
     
    The Recursive Book of Recursion uses Python and JavaScript examples to teach the basics of recursion, exposing the ways that it’s often poorly taught and clarifying the fundamental principles of all recursive algorithms. You’ll learn when to use recursive functions (and, most importantly, when not to use them), how to implement the classic recursive algorithms often brought up in job interviews, and how recursive techniques can help solve countless problems involving tree traversal, combinatorics, and other tricky topics.
     
    This project-based guide contains complete, runnable programs to help you learn:
     
  • How recursive functions make use of the call stack, a critical data structure almost never discussed in lessons on recursion
  • How the head-tail and “leap of faith” techniques can simplify writing recursive functions
  • How to use recursion to write custom search scripts for your filesystem, draw fractal art, create mazes, and more
  • How optimization and memoization make recursive algorithms more efficient
  •  
    Al Sweigart has built a career explaining programming concepts in a fun, approachable manner. If you’ve shied away from learning recursion but want to add this technique to your programming toolkit, or if you’re racing to prepare for your next job interview, this book is for you.

    Praise

    "This book takes the mystery out of recursion. By the time you finish it, you'll see recursion as a powerful technique, but also a technique usable by mere mortals."
    —John D. Cook

    "... this book is a worthy read for a developer who wants to deepen their knowledge of advanced programming topics. While basic recursion is included in early programming curriculum, it typically stops at examples that can be reproduced with iteration. In this book, Al Sweigart starts are these basics and quickly expands to include types of algorithms that benefit from recursion, such as tree traversal and divide-and-conquer. Though focused on those actively interviewing for engineering roles, the book is also a good fit for professional development, an engineering book club, or a brain tickler for your technical book shelf. The real life projects at the end are especially informative, which is why I think... (this review 'recurs' to the beginning)"
    —Adam DuVander, @adamd, Founder of EveryDeveloper

    "I have felt for a long time that I had a pretty good handle on the subject of recursion . . . Thanks to Al Sweigart's new book, I think I'm far better informed than I was before. I will re-read this book a couple more times, just to add to the knowledge."
    —Ronnie Tucker, Editor, Full Circle Magazine

    Author

    Al Sweigart is a software developer and tech book author living in Houston. Python is his favorite programming language, and he is the developer of several open source modules for it. His other books are freely available under a Creative Commons license on his website at https://www.inventwithpython.com/.

    Rights

    Available for sale exclusive:
    •     Afghanistan
    •     Aland Islands
    •     Albania
    •     Algeria
    •     Andorra
    •     Angola
    •     Anguilla
    •     Antarctica
    •     Antigua/Barbuda
    •     Argentina
    •     Armenia
    •     Aruba
    •     Australia
    •     Austria
    •     Azerbaijan
    •     Bahamas
    •     Bahrain
    •     Bangladesh
    •     Barbados
    •     Belarus
    •     Belgium
    •     Belize
    •     Benin
    •     Bermuda
    •     Bhutan
    •     Bolivia
    •     Bonaire, Saba
    •     Bosnia Herzeg.
    •     Botswana
    •     Bouvet Island
    •     Brazil
    •     Brit.Ind.Oc.Ter
    •     Brit.Virgin Is.
    •     Brunei
    •     Bulgaria
    •     Burkina Faso
    •     Burundi
    •     Cambodia
    •     Cameroon
    •     Canada
    •     Cape Verde
    •     Cayman Islands
    •     Centr.Afr.Rep.
    •     Chad
    •     Chile
    •     China
    •     Christmas Islnd
    •     Cocos Islands
    •     Colombia
    •     Comoro Is.
    •     Congo
    •     Cook Islands
    •     Costa Rica
    •     Croatia
    •     Cuba
    •     Curacao
    •     Cyprus
    •     Czech Republic
    •     Dem. Rep. Congo
    •     Denmark
    •     Djibouti
    •     Dominica
    •     Dominican Rep.
    •     Ecuador
    •     Egypt
    •     El Salvador
    •     Equatorial Gui.
    •     Eritrea
    •     Estonia
    •     Ethiopia
    •     Falkland Islnds
    •     Faroe Islands
    •     Fiji
    •     Finland
    •     France
    •     Fren.Polynesia
    •     French Guinea
    •     Gabon
    •     Gambia
    •     Georgia
    •     Germany
    •     Ghana
    •     Gibraltar
    •     Greece
    •     Greenland
    •     Grenada
    •     Guadeloupe
    •     Guam
    •     Guatemala
    •     Guernsey
    •     Guinea Republic
    •     Guinea-Bissau
    •     Guyana
    •     Haiti
    •     Heard/McDon.Isl
    •     Honduras
    •     Hong Kong
    •     Hungary
    •     Iceland
    •     India
    •     Indonesia
    •     Iran
    •     Iraq
    •     Ireland
    •     Isle of Man
    •     Israel
    •     Italy
    •     Ivory Coast
    •     Jamaica
    •     Japan
    •     Jersey
    •     Jordan
    •     Kazakhstan
    •     Kenya
    •     Kiribati
    •     Kuwait
    •     Kyrgyzstan
    •     Laos
    •     Latvia
    •     Lebanon
    •     Lesotho
    •     Liberia
    •     Libya
    •     Liechtenstein
    •     Lithuania
    •     Luxembourg
    •     Macau
    •     Macedonia
    •     Madagascar
    •     Malawi
    •     Malaysia
    •     Maldives
    •     Mali
    •     Malta
    •     Marshall island
    •     Martinique
    •     Mauritania
    •     Mauritius
    •     Mayotte
    •     Mexico
    •     Micronesia
    •     Minor Outl.Ins.
    •     Moldavia
    •     Monaco
    •     Mongolia
    •     Montenegro
    •     Montserrat
    •     Morocco
    •     Mozambique
    •     Myanmar
    •     Namibia
    •     Nauru
    •     Nepal
    •     Netherlands
    •     New Caledonia
    •     New Zealand
    •     Nicaragua
    •     Niger
    •     Nigeria
    •     Niue
    •     Norfolk Island
    •     North Korea
    •     North Mariana
    •     Norway
    •     Oman
    •     Pakistan
    •     Palau
    •     Palestinian Ter
    •     Panama
    •     PapuaNewGuinea
    •     Paraguay
    •     Peru
    •     Philippines
    •     Pitcairn Islnds
    •     Poland
    •     Portugal
    •     Puerto Rico
    •     Qatar
    •     Reunion Island
    •     Romania
    •     Russian Fed.
    •     Rwanda
    •     S. Sandwich Ins
    •     Saint Martin
    •     Samoa,American
    •     San Marino
    •     SaoTome Princip
    •     Saudi Arabia
    •     Senegal
    •     Serbia
    •     Seychelles
    •     Sierra Leone
    •     Singapore
    •     Sint Maarten
    •     Slovakia
    •     Slovenia
    •     Solomon Islands
    •     Somalia
    •     South Africa
    •     South Korea
    •     South Sudan
    •     Spain
    •     Sri Lanka
    •     St Barthelemy
    •     St. Helena
    •     St. Lucia
    •     St. Vincent
    •     St.Chr.,Nevis
    •     St.Pier,Miquel.
    •     Sth Terr. Franc
    •     Sudan
    •     Suriname
    •     Svalbard
    •     Swaziland
    •     Sweden
    •     Switzerland
    •     Syria
    •     Tadschikistan
    •     Taiwan
    •     Tanzania
    •     Thailand
    •     Timor-Leste
    •     Togo
    •     Tokelau Islands
    •     Tonga
    •     Trinidad,Tobago
    •     Tunisia
    •     Turkey
    •     Turkmenistan
    •     Turks&Caicos Is
    •     Tuvalu
    •     US Virgin Is.
    •     USA
    •     Uganda
    •     Ukraine
    •     Unit.Arab Emir.
    •     United Kingdom
    •     Uruguay
    •     Uzbekistan
    •     Vanuatu
    •     Vatican City
    •     Venezuela
    •     Vietnam
    •     Wallis,Futuna
    •     West Saharan
    •     Western Samoa
    •     Yemen
    •     Zambia
    •     Zimbabwe