Adding Haskell examples (#17)
* 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
This commit is contained in:
committed by
Aditya Bhargava
parent
c5c2563d05
commit
6f78bdf3d7
6
03_recursion/Haskell/03_factorial.hs
Normal file
6
03_recursion/Haskell/03_factorial.hs
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
fact n
|
||||
| n <= 1 = 1
|
||||
| otherwise = n * (fact (n-1))
|
||||
|
||||
main = (putStrLn . show . fact) 5
|
||||
Reference in New Issue
Block a user