Recursive algorithm examples