Skip to content

Instantly share code, notes, and snippets.

View longda's full-sized avatar
🌴

David Long longda

🌴
View GitHub Profile
@longda
longda / Dijkstra.java
Last active August 29, 2015 14:15
Prep
//http://ideone.com/AW2VoY
/* package whatever dijkstra w/ priority queue; // don't place package name! */
import java.util.PriorityQueue;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
class Vertex implements Comparable<Vertex>
{
/*
https://www.hackerrank.com/challenges/pairs
Given N integers, count the number of pairs of integers whose difference is K.
Input Format
The first line contains N and K.
The second line contains N numbers of the set. All the N numbers are unique.