Skip to content

Latest commit

 

History

History
29 lines (16 loc) · 603 Bytes

README.md

File metadata and controls

29 lines (16 loc) · 603 Bytes

Cantor pair function in Go

1. cantor pair function

image

cantor pair function reference

https://en.wikipedia.org/wiki/Cantor_function

https://en.wikipedia.org/wiki/Pairing_function

https://gist.github.com/hannesl/8031402 



go run main.go

**func cantor_pair_calculate()**
33, 1  =>  596
6, 8  =>  113
596, 113  =>  251808

**func cantor_pair_reverse()**
251808 =>  596, 113
596 => 33, 1
113 => 6, 8