Category: recursive
The problem of ‘Tower of Hanoi’ is a very classic problem/puzzle that is often used to teach recursion in Computer Science. The problem can be described as moving a …
The Ackermann function is mathematically defined as: The Ack function is well-defined total math function which is compute-able but not a primitive recursive function. Its value grow so quickly …
This problem is from codeforces: http://www.codeforces.com/problemset/problem/263/D This is a graph-related problem but it took me days to get it right. First i made a mistake in using Python language, see …
In , the GCD (Greatest Common Divisor) is given in brief details. The algorithm can be implemented in both recursive and iterative forms. The recursive formula is , and …
Quick Sort is a comparison sorting method, on average, the complexity is . In worst cases, e.g. when the array of elements are already sorted, it is degraded into …