Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Java Functional Programming

You're reading from   Learning Java Functional Programming Create robust and maintainable Java applications using the functional style of programming

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781783558483
Length 296 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Richard M. Reese Richard M. Reese
Author Profile Icon Richard M. Reese
Richard M. Reese
Richard M Reese Richard M Reese
Author Profile Icon Richard M Reese
Richard M Reese
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Getting Started with Functional Programming 2. Putting the Function in Functional Programming FREE CHAPTER 3. Function Composition and Fluent Interfaces 4. Streams and the Evaluation of Expressions 5. Recursion Techniques in Java 8 6. Optional and Monads 7. Supporting Design Patterns Using Functional Programming 8. Refactoring, Debugging, and Testing 9. Bringing It All Together Index

Recursive data structures


A recursive data structure contains references to itself, such as a list or tree. These types of structures are dynamic data structures where the structure can theoretically grow to an infinite length.

The recursive nature of this data structure lends itself to recursive algorithms. Examples of recursive data structures include:

  • Linked lists

  • Trees

  • Filesystems

  • Graph

It is sometimes thought that recursive methods work differently from regular methods. They don't. They both simply return when they are completed. A problem that can be solved using iteration can be solved using recursion. A problem that can be solved using recursion can be solved using iteration.

A recursive solution will typically take more space than an iterative solution. Each time a method is called, an activation record is created for the method. This activation record will contain its parameters and any local variables as is detailed in Understanding the program stack. An iterative solution will require...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime