Algorithm Implementation for Stanford Algorithms