Skip to content

Instantly share code, notes, and snippets.

View Mandar-Shinde's full-sized avatar

Mandar Shinde Mandar-Shinde

View GitHub Profile
@Mandar-Shinde
Mandar-Shinde / gist:fbb01ce0d16ae6871b77
Created February 10, 2016 06:16 — forked from mejibyte/gist:1268711
My implementation of the Knuth-Morris-Pratt algorithm in C++
// http://www.spoj.pl/problems/NHAY/
#include <vector>
#include <iostream>
#include <string>
#include <cstdio>
using namespace std;
void kmp(const string &needle, const string &haystack) {
int m = needle.size();
vector<int> border(m + 1);
@Mandar-Shinde
Mandar-Shinde / mp3.c
Created January 3, 2016 16:51 — forked from wh5a/mp3.c
CUDA Matrix Multiplication with Shared Memory
// MP 2: Due Sunday, Dec 16, 2012 at 11:59 p.m. PST
#include <wb.h>
#define wbCheck(stmt) do { \
cudaError_t err = stmt; \
if (err != cudaSuccess) { \
wbLog(ERROR, "Failed to run stmt ", #stmt); \
return -1; \
} \
} while(0)
@Mandar-Shinde
Mandar-Shinde / 0_reuse_code.js
Created October 11, 2015 13:32
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