Skip to content

Instantly share code, notes, and snippets.

@hillscottc
hillscottc / TestFloyd.py
Last active August 29, 2015 14:02 — forked from Ceasar/floydwarshall.py
The Floyd-Warshall, All-Pairs Shortest Path algorithm.
import unittest
from floydwarshall import floyd
class TestFloyd(unittest.TestCase):
def test_floyd_1(self):
inf = float('inf')
g = {0: {0: 0, 1: 1, 2: 4},
1: {0: inf, 1: 0, 2: 2},
@hillscottc
hillscottc / lcs.py
Created June 1, 2014 04:43 — forked from istepanov/lcs.py
Longest common substrings using generalized suffix trees built with Ukkonen's algorithm.
#!/usr/bin/env python
# -*- coding: utf-8
"""
Search longest common substrings using generalized suffix trees built with Ukkonen's algorithm
Author: Ilya Stepanov <code at ilyastepanov.com>
(c) 2013
"""
@hillscottc
hillscottc / 0_reuse_code.js
Created May 23, 2014 16:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console