{{ message }}

Instantly share code, notes, and snippets.

# Daniel Rangel danielrangelmoreira

Created Feb 5, 2017
View keybase.md

### Keybase proof

I hereby claim:

• I am danielrangelmoreira on github.
• I am danielrangel (https://keybase.io/danielrangel) on keybase.
• I have a public key ASBXWaRcYRFi-X9IvsNKjfVxst5AUGHUY_uZGoeWrdpH2Ao

To claim this, I am signing this object:

Created Mar 19, 2017
Naive way of obtaining square roots with newton's approximation method
View newtonsqrt.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 package main import ( "fmt" //"math" ) func main() { const ( x0 = 54777
Created Apr 23, 2017 — forked from iandioch/totients.go
Golang implementation of Euler's totient/phi function
View totients.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 /* * Go implementation of Euler's product formula to find for the totient function (aka. phi function) * https://en.wikipedia.org/wiki/Euler's_totient_function#Euler.27s_product_formula */ package main import ( "fmt" )
Last active Apr 30, 2017
Non recursive Heap (1963) algorithm
View heapPermutation.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 package main import "fmt" func generate(n int, a []int64) { var c = make([]int, n) fmt.Println(a) i := 0 for i < n { if c[i] < i {
Created May 18, 2017
Insert items in a sorted slice/array (golang)
View insert.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 package main import "sort" import "fmt" func main() { data := []int{20, 21, 22, 24, 25, 26, 28, 29, 30, 31, 32} var items = []int{23, 27} for _, x := range items {
Last active Nov 17, 2020
Fastest, coolest, fibonacci algorithm golang with dynamic programming
View fib.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 package main import ( "fmt" "math/big" ) func fib(n int) *big.Int { fn := make([]*big.Int, n+1) for i := 0; i <= n; i++ {