Recursive Functions

San Skulrattanakulchai

March 30, 2020

Topics

Recursive functions

Example recursive function

Characteristics of recursive functions

Tower of Hanoi

ToH solution

ToH solution in Kotlin

Recursive Graphics

Drawing the even-level H-Trees

Exercise on drawing the H-Trees

Sierpinski triangle

The cost of recursion

Tail recursion

Tail call optimization