This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tutorial.protobuf; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.PriorityQueue; | |
public class Huffman { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i=n/2 downto 1 | |
do max_heapify(A, i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.wordpress.nullpointerexception1</groupId> | |
<artifactId>myRestProject</artifactId> | |
<version>1.0-SNAPSHOT</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.dropwizard.Configuration; | |
/** | |
* Created by harshvardhan on 12/07/18. | |
*/ | |
public class MyConfiguration extends Configuration { | |
private String url; | |
public String getUrl() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url: https://nullpointerexception1.wordpress.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url: https://nullpointerexception1.wordpress.com/ |
OlderNewer