Skip to content

Instantly share code, notes, and snippets.

View sometimescasey's full-sized avatar

Casey Li sometimescasey

View GitHub Profile
@sometimescasey
sometimescasey / kbit_rev_permute.c
Last active July 12, 2018 15:18
CSC263 A3 Q4 - kbit reverse permutation
/*
Summer 2018
CSC263 Assignment 3 Question 4
Describe an implementation of the BITREVERSEDINCREMENT procedure on A that allows
the bit-reversal permutation on an n-element array to be performed in time O(n).
Note: compile needs -lm flag for <math.h>:
gcc -Wall -o kbit_rev_permute kbit_rev_permute.c -lm
*/
@sometimescasey
sometimescasey / bfs_count_paths.c
Last active July 12, 2018 15:13
CSC263 A3 Q7 - BFS - count shortest paths
/*
Summer 2018
CSC263 Assignment 3 Question 7
We consider undirected graphs (with no weights).
Often there are multiple shortest paths between two nodes of a graph.
Describe a linear-time algorithm such that, given an undirected, unweighted graph
and two vertices u and v, the algorithm counts the number of distinct shortest paths
from u to v. Justify its correctness and the running time.
@sometimescasey
sometimescasey / mnist_cnn.py
Last active November 18, 2019 12:12
TensorFlow tutorial: Small CNN to process MNIST data
# From instructions at https://www.tensorflow.org/versions/r1.0/get_started/mnist/pros
import argparse
import sys
import tensorflow as tf
import time
from tensorflow.examples.tutorials.mnist import input_data
FLAGS = None