Join Peggy Fisher for an in-depth discussion in this video Leveraging recursion, part of Java Essential Training for Students.
- When talking about program efficiency,…sometimes it's good to take a look…at maybe writing your program recursively.…Recursion is a process of a method that…calls itself to solve a problem.…Sometimes this process can help reduce the…space requirement or the execution time,…and therefore make the program more efficient.…It can call itself again and again to help break down…a larger problem to solve it in smaller steps.…Let's take a look at a simple example where we wanna…print out a countdown from 10 to one…and then print the word "blastoff."…So in this example, we wanna stop when…the number gets to zero.…
In the main, we print out the message…"The countdown has begun!!"…Then we call the countDown method and…we give it the number 10.…That transfers control to line 19 where…we have our countDown method.…So the count variable now has the number 10.…It says if(count == 0) return;…because that's our base case.…In any recursive problem, it's really important…to figure out what constitutes the end of your process.…In this case, it's when count reaches zero.…
- Getting started with parsing
- Reviewing data types
- Using decisions
- Creating user-defined methods
- Command-line debugging
- Exploring the Java API
- Creating and instantiating classes
- Working with interfaces
- Storing items with arrays
Skill Level Intermediate
1. Command Level Programming
2. Basics Review
4. Java API
5. Simulations and Algorithm Analysis
6. Classes and Objects
7. More on Classes
8. Data Structures
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.