Skip to content

Instantly share code, notes, and snippets.

rohitsingh20122992 /
Last active Nov 13, 2017
Huffman code, Huffman Tree, Huffman encoading
package com.tutorial.protobuf;
import java.util.HashMap;
import java.util.Map;
import java.util.PriorityQueue;
public class Huffman {
rohitsingh20122992 /
Last active Nov 18, 2017
A decision tree model based on Melbourne Housing Dataset.
# coding: utf-8
# In[1]:
#Pandas is the primary tool that modern data scientists use for exploring and manipulating data. Let's import it.
import pandas as pd
# In[6]:
View max_heapify_pseudocode.txt
index_of_left_child = left(i);
index_of_right_child = right(i);
heap_size = number_of_elements_in_heap(A)
if((index_of_left_child <= heap_size) && (A[index_of_left_child] > A[i]))
largest = index_of_left_child
largest = i
rohitsingh20122992 /
Created Jul 7, 2018
Graph Representation In Python. Key is vertice name and value is set of neighbouring vertices.
graph = {'A' : set(['G','B']),
'B' : set(['C','D','A']),
'C' : set(['F','D','B']),
'D' : set(['B','C']),
'E' : set(['F']),
'F' : set(['E','C']),
'G' : set(['A']),
print graph
rohitsingh20122992 /
Created Jul 7, 2018
Depth First Search Python Implementation : Prints all the nodes of the graph
def depth_first_search(graph, start_node):
visited_neighbours = set() #Keep track of the node we have visited like breadcrumbs to know the path
neighbours = [start_node] #list to store the neighbors. We will start with neigbors of void, the start node
while (len(neighbours) != 0): #All the elements will be transversed by the time we have this list size as zero
neighbour = neighbours.pop() #pop will take out randomly any one element and deletes from the list
if neighbour not in visited_neighbours:
new_prospected_neighbours = graph[neighbour]
#Need to remove neighbours which are already visted
rohitsingh20122992 / pom.xml
Created Jul 12, 2018
POM with dropwizard core dependency
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""
rohitsingh20122992 /
Created Jul 12, 2018
Configuration file for dropwizard application
import io.dropwizard.Configuration;
* Created by harshvardhan on 12/07/18.
public class MyConfiguration extends Configuration {
private String url;
public String getUrl() {
View dev.yml
View dev.yml