Java Arena

Module 55 Extra

Recursion

An extra module, not part of the MOOC. Methods that call themselves, the base case that stops them, recursion on numbers, strings and arrays, what a missing base case does (a StackOverflowError), and two classic divide-and-conquer algorithms written recursively, binary search and merge sort.

Steps

  1. A method that calls itself
  2. Base case and return value
  3. Recursion on strings and arrays
  4. When recursion goes wrong
  5. Recursive binary search
  6. Divide and conquer: merge sort