This file contains hidden or 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
// 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) { |
This file contains hidden or 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
/* 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 ;) |
This file contains hidden or 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
#!/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): |
This file contains hidden or 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
// 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; |
This file contains hidden or 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
import math | |
g1 = [ | |
[0, 1, 2, math.inf], | |
[1, 0, 3, 4], | |
[2, 3, 0, 15], | |
[math.inf, 4, 15 ,0] | |
] | |
g2 = [ |