Skip to content

Instantly share code, notes, and snippets.

View vgangireddyin's full-sized avatar

Venu Gangireddy vgangireddyin

View GitHub Profile
@vgangireddyin
vgangireddyin / bintree_equivalence.go
Created May 11, 2016 12:22
Go Tour: Equivalent Binary Trees
package main
import (
"golang.org/x/tour/tree"
"fmt"
)
func walkrec(t *tree.Tree, ch chan int){
if t == nil {
@vgangireddyin
vgangireddyin / tcp_client.go
Created May 26, 2016 18:24
Simple TCP Server in Golang
package main
import (
"fmt"
"net"
"bufio"
"os"
)
func main() {
package main
import(
"fmt"
"time"
)
func Publish(text string, delay time.Duration) {
/**
* Create a thread at os level and shedule by go sheduler
@vgangireddyin
vgangireddyin / .ctags
Last active May 30, 2016 12:35
My Vim Setup for GoLang
--langdef=Go
--langmap=Go:.go
--regex-Go=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/f,func/
--regex-Go=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/v,var/
--regex-Go=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/t,type/
@vgangireddyin
vgangireddyin / range_tree.cpp
Created June 5, 2016 07:30
Range Tree in CPP
#include <iostream>
#include <vector>
#include <algorithm>
#include <time.h>
#include <math.h>
using namespace std;
struct point
@vgangireddyin
vgangireddyin / kd_tree.cpp
Created June 5, 2016 07:33
KD Tree in CPP
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <math.h>
#define E 0.000001
using namespace std;
struct point
{
@vgangireddyin
vgangireddyin / quad_tree.cpp
Created June 5, 2016 07:34
Quad Tree in CPP
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#define E 0.000001
using namespace std;
struct point
@vgangireddyin
vgangireddyin / bplus_tree.cpp
Created June 5, 2016 07:35
BPlus Tree in CPP
#include <vector>
#include <stdio.h>
#include <stack>
#include <stdlib.h>
#include <fstream>
#include <math.h>
#include <time.h>
using namespace std;
@vgangireddyin
vgangireddyin / rtree.cpp
Last active December 6, 2016 11:16
RTree in CPP
/*
* main.cpp
*
* Created on: 12-Mar-2015
* Author: gangireddy
*
* R-tree implemenatation in cpp
*/
#include <iostream>
#include <vector>
@vgangireddyin
vgangireddyin / neuron_network.py
Last active September 29, 2017 16:48
Basic Neuron Network Implementation
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 10 17:48:52 2015
@author: gangireddy
Thanks to http://danielfrg.com/ for this basic neural network implementation, it is modified accordingly
"""
import math
import random