Skip to content

Instantly share code, notes, and snippets.

View brunofurmon's full-sized avatar
💥
"Every time you make a typo, the errorists win."

Bruno Furtado Montes Oliveira brunofurmon

💥
"Every time you make a typo, the errorists win."
View GitHub Profile
import math
g1 = [
[0, 1, 2, math.inf],
[1, 0, 3, 4],
[2, 3, 0, 15],
[math.inf, 4, 15 ,0]
]
g2 = [
// Combination of 2.
// Took about 1 second with an array with 1000 unique ints
var a = [0,1,2];
var combs = [];
var combinationOf2 = function(a)
{
var combs = [];
var size = a.length;
#!/usr/bin/env python3
''' Node that carries an integer and a reference to its childs (Nodes)
'''
class Node(object):
def __init__(self, data):
self.data = data
self.children = []
def append(self, node):
@brunofurmon
brunofurmon / Caesar.c
Last active September 16, 2020 12:42
This program implements a simple Cypher (Caesar's Cypher) on a text file. Ansi C
/* Implementa cifra de Caesar em arquivos de texto
* Uso: ./caesar <E/D> <CIFRA> <arquivoEntrada.txt> <arquivoSaida.txt>
* onde:
* 'E' soma a cada caracter o valor da cifra
* 'D' subtrai de cada caracter o valor da cifra
*
* Autor: Bruno Furtado Montes Oliveira
* github.com/brunofurmon
* skype: brunofurmon
* For an english explanation, get in contact ;)
// Autor: Bruno Furtado
// https://gist.github.com/brunofurmon
#include <iostream>
#include <fstream>
#include <sys/time.h>
// Método Recursivo
void potRec(int base, int exponent) {