Recursion occurs when a function calls itself. Recursion is useful when dealing with problems that have recursive properties. Consider a function factorial(n) that returns the factorial of n. This function can be defined recursively because factorial(5) = 5 * factorial(4) = 5 * 4 * factorial(3) and so on.Read More
The problem is: Given N pairs of parentheses, write a function to generate all combinations of well-formed parentheses. The naive solution is to generate all combinations of N pairs of parentheses, then checking if each one is valid.Read More
Now, if you change main.c, factorial.c, or factorial.h, you would need to re-compile those files manually. This is a cumbersome process, especially when the number of files is big. The solution is to automate the compilation process by using Makefile.Read More
A pointer is simply a variable that stores the address of another variable.
An address of a variable is where the variable is located in memory. For example, if you declare int n = 8; in your program, then your computer’s memory would look something like this…Read More