WRITELOOP

GROKKING ALGORITHMS - DIVIDE AND CONQUER

2022 April 26
  • Divide-and-Conquer is a recursive technique to solve problems.

  • Quicksort is a Divide-and-Conquer algorithm

  • To solve a problem using Divide-and-Conquer, there are 2 steps:

    1. Figure out the base case (the simplest possible case)
    2. Divide or decrease the problem until it becomes the base case.
  • Divide-and-Conquer is not an algorithm. It’s a way to think about a problem.

  • When you are writing a recursive function that has an array as part of the problem, the base case is often an empty array or an array with one element.

  • Recursive algorithms are used on functional programming languages - since they do not have loops. So, a good understanding of recursion makes functional languages easier to learn.

  • If you want to dive into recursion, use may try Haskell - a functional programming language.

NOTE: The original content(s) that inspired this one can be found at:
https://www.amazon.com/Grokking-Algorithms-illustrated-programmers-curious/dp/1617292230
All copyright and intellectual property of each one belongs to its' original author.