Skip to content

Instantly share code, notes, and snippets.

View kuriringohankamehameha's full-sized avatar

Vijay kuriringohankamehameha

View GitHub Profile
@kuriringohankamehameha
kuriringohankamehameha / word2vec_cbow.py
Created April 7, 2020 10:27
A sample word2vec implementation of the Continuous Bag of Words model in Numpy
import numpy as np
import re
from nltk.corpus import brown
import matplotlib.pyplot as plt
import time
def tokenize(text):
pattern = re.compile(r'[A-Za-z]+[\w^\']*|[\w^\']*[A-Za-z]+[\w^\']*')
try:
@kuriringohankamehameha
kuriringohankamehameha / lru_cache.cpp
Last active March 31, 2020 05:02
A sample of a LRU Cache
#include <iostream>
#include <vector>
#include <map>
template <typename T>
struct CircularQueue {
std::pair<T, T> data;
size_t size;
CircularQueue* prev, *next;
CircularQueue(std::pair<T, T> data = std::make_pair(0, 0)) { this->data = data; prev = next = nullptr; size = 0; }
@kuriringohankamehameha
kuriringohankamehameha / binary_search_tree.c
Last active March 8, 2020 14:13
An Implementation of a Binary Search Tree
/**
Code for https://journaldev.com article
Purpose: A Binary Search Tree Implementation
@author: Vijay Ramachandran
@date: 08-03-2020
*/
#include <stdio.h>
#include <stdlib.h>
typedef struct TreeNode {
/**
Code for https://journaldev.com article
Purpose: A Min Heap Implementation, representing the Binary Tree as an Array
@author: Vijay Ramachandran
@date: 27-02-2020
*/
#include <stdio.h>
#include <stdlib.h>
@kuriringohankamehameha
kuriringohankamehameha / trie.c
Last active January 3, 2024 20:12
An Implementation of a Trie Data Strcture, with Insertion, Searching and Deletion
/**
Code for https://journaldev.com article
Purpose: A Trie Data Structure Implementation in C
@author: Vijay Ramachandran
@date: 20-02-2020
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@kuriringohankamehameha
kuriringohankamehameha / depth_first_search.c
Created February 14, 2020 20:41
Performs a Depth First Search on a Graph
/**
Code for https://journaldev.com article
Purpose: A Depth First Search Implementation
@author: Vijay Ramachandran
@date: 14-02-2020
*/
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
@kuriringohankamehameha
kuriringohankamehameha / hash_table.c
Last active April 16, 2023 19:27
An Implementation of a Hash Table using Separate Chaining
/**
Code for https://journaldev.com article
Purpose: A Hash Table Implementation
@author: Vijay Ramachandran
@date: 01-02-2020
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@kuriringohankamehameha
kuriringohankamehameha / level_order.c
Created January 28, 2020 07:15
Performs Level Order Traversal across a Binary Tree
/**
Code for https://journaldev.com article
Purpose: Performs Level Order Traversal across a Binary Tree
@author: Vijay Ramachandran
@date: 28-01-2020
*/
#include <stdio.h>
#include <stdlib.h>
@kuriringohankamehameha
kuriringohankamehameha / shell.c
Last active October 19, 2019 00:07
Shell Shell Handling
#include<stdio.h>
#include<stdlib.h>
#include<pthread.h>
#include<string.h>
#include<unistd.h>
#include<sys/types.h>
#include<signal.h>
static void shellHandler(int signo, siginfo_t* info, void* context)
{