Original function does not work when input array is empty or contains a single value. In the revised code, base case has been augmented to support those. Works successfully for all these test cases: find_max([1, 12, 8, 5]), find_max([]), find_max([1])
The Definition of a Zero Factorial
Because zero has no lower numbers but is still in and of itself a number, there is still but one possible combination of how that data set can be arranged: it cannot. This still counts as one way of arranging it, so by definition, a zero factorial is equal to one, just as 1! is equal to one because there is only a single possible arrangement of this data set.
The original code does not return the value in the if-clause and the return statement in the else-clause, which led to the function returning None at the end of the countdown (5, 4, 3, 2, 1, 0, None).
* binary search c++
* selection sort c++11
* c++ recursive countdown
* c++ recursion
* c++ quicksort
* rename folder names to c++11
* add another version of binary_search function
* c++11 hash tables
* c++11 breadth-first search
* Create 01_countdown.pl
Recursion example #1 written in Perl 5
* Create 02_greet.pl
Recirsion example #2 written in Perl 5
* Create 03_factorial.pl
Recursion example #3 written in Perl 5
* Update 01_selection_sort.py
Updated last print statement for Python 3 print function.
* Update 01_countdown.py
Updated print statement to print function for Python 3.
* Update 05_quicksort.py
Updated print statement to print function for Python 3.
* Update 01_price_of_groceries.py
Condensed dictionary creation into one line, edited print statement to a print function for Python 3.
* Update 01_set_covering.py
Changed print statement to print function for Python 3.
* Update 01_binary_search.py
Changed print statements to print function for Python 3.
* add ES6 example for binary search
* add ES6 example for selection sort
* add ES6 example for countdown
* add ES6 example for greet
* add ES6 example for factorial
* edit ES6 example for quicksort
* add ES6 example for loop sum
* add ES6 example for recursive sum
* add ES6 example for recursive count
* add ES6 example for recursive max
* add ES6 example for price of groceries
* add ES6 example for check voter
* add ES6 example for breadth-first search
* add ES6 example for dijkstras algorithm
* edit ES6 example for dijkstras algorithm
* edit ES6 example for set covering
* add ES6 example for longest common subsequence
* Adding binary search example for Haskell
* Adding selection sort example in Haskell
* Adding Haskell examples for chapter 3
* Adding examples for chapter 4
* Adding examples for chapter 5
* Adding git ignore
* Add Haskell example for BFS
* code for chapters 3-9 in Java
* code for chapters 1 in Java
* code for chapter 2 in Java
* missing CheckVoter for chapter 5 in Java
* add missing sample output for SetCovering as a comment
* 01_binary_search Swift 3.0.2
* 01_binary_search Swift 3.0.2
* add Chapter 2 - 01_selection_sort Swift 3.0.2 example
* 01_binary_search cosmetic note updates Swift 3.0.2
* 03_recursion Swift 3.0.2 examples
* 04_quicksort Swift 3.0.2 examples
* fix typo on quicksort example. Swift 3.0.2
* add 05_hash_tables examples on Swift 3.0.2
* add 01_breadth-first_search Swift 3.0.2 example
* 01_breadth-first_search fixing typo Swift 3.0.2
* add 01_dijkstras_algorithm on Swift 3.0.2
* add 08_greedy_algorithms Swift 3.0.2 example
* 01_longest_common_subsequence Swift 3.0.2 example