{{ message }}

Instantly share code, notes, and snippets.

# rohitsingh20122992

Last active Nov 13, 2017
Huffman code, Huffman Tree, Huffman encoading
View Huffman.java
 package com.tutorial.protobuf; import java.util.HashMap; import java.util.Map; import java.util.PriorityQueue; public class Huffman {
Last active Nov 18, 2017
A decision tree model based on Melbourne Housing Dataset.
View melbourne_housing_price_prediction.py
 # 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]:
Created Apr 28, 2018
View max_heapify_pseudocode.txt
 max-heapify(A,i){ 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 else largest = i
Created Apr 28, 2018
View build_max_heap_pseudocode.txt
 for i=n/2 downto 1 do max_heapify(A, i)
Created Jul 7, 2018
Graph Representation In Python. Key is vertice name and value is set of neighbouring vertices.
View graph_dict.py
 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
Created Jul 7, 2018
Depth First Search Python Implementation : Prints all the nodes of the graph
View depth_first_search.py
 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: visited_neighbours.add(neighbour) new_prospected_neighbours = graph[neighbour] #Need to remove neighbours which are already visted
Created Jul 12, 2018
POM with dropwizard core dependency
View pom.xml
 4.0.0 com.wordpress.nullpointerexception1 myRestProject 1.0-SNAPSHOT
Created Jul 12, 2018
Configuration file for dropwizard application
View MyConfiguration.java
 import io.dropwizard.Configuration; /** * Created by harshvardhan on 12/07/18. */ public class MyConfiguration extends Configuration { private String url; public String getUrl() {
Created Jul 12, 2018
View dev.yml
 url: https://nullpointerexception1.wordpress.com/
Created Jul 12, 2018
View dev.yml
 url: https://nullpointerexception1.wordpress.com/