https://www.gravatar.com/avatar/0e2f7fc4c0996f33a4ee09b16f2ebb14?s=240&d=mp

CODEPHILOSOPHER

Tail Recursion

Into In Tail Recursion, recursive call is the last statement to be executed by the function. In other words, recursive function will put at the end of the function. So here all other statements are executed on the recursive calling time itself because all other statements are called before the recursive function. So there wont be anything executed after returning time of the recursive call. code example 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 package main import "fmt" func main() { x := 3 recFunc(x) } func recFunc(n int) { if n > 0 { fmt.

Head Recursion

intro In Head Recursion, the function call its self and function call will be the first statement than any other statement. code example 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 package main import "fmt" func main() { x := 3 recFunc(x) } func recFunc(n int) { if n > 0 { recFunc(n - 1) fmt.Printf("%d ", n) } } In the above example code, inside the if condition recFunc is the first statement.

Recursion

Intro recursion is a method of solving a computational problem where the solution depends on solutions to smaller instances of the same problem. Recursion solves such recursive problems by using functions that call themselves from within their own code Repeatedly calling a function from within itself may cause the call stack to have a size equal to the sum of the input sizes of all involved calls. It follows that, for problems that can be solved easily by iteration, recursion is generally less efficient, and, for large problems, it is fundamental to use optimization techniques such as tail call optimization.

Golang setups in Windows and Unix enviroments

Setup Golang is not that hard. To install golang your can go to golang downloads . Windows If you are going to install on windows you can download windows binaries of 32/64 architects if you are planning to download the compressed files, you have to set path variables in system environment. or you can install the installer with msi version, which will install and do all the necessary settings for you.