Skip to content

Instantly share code, notes, and snippets.

@piyushmaurya23
Last active October 16, 2015 20:28
Show Gist options
  • Save piyushmaurya23/0ba52ca0452337ddd6df to your computer and use it in GitHub Desktop.
Save piyushmaurya23/0ba52ca0452337ddd6df to your computer and use it in GitHub Desktop.
3. Define a Recursive LISP function to solve Ackermann’s Function.
(defun akermann(m n)
(cond
((= m 0) (+ n 1))
((and (> m 0) (= n 0)) (akermann (- m 1) 1))
((and (> m 0) (> n 0)) (akermann (- m 1) (akermann m (- n 1))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment