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 java.util.*; | |
class Graph { | |
int V; //num. of Vertices | |
LinkedList<Integer> adj[]; //Adjacency lists | |
Graph(int v) { | |
V = v; | |
adj = new LinkedList[v]; |
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 java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.Map; | |
public class GraphDijkstra { | |
final String START_NAME = "start"; | |
final String FINAL_NAME = "final"; | |
HashMap<String, HashMap<String, Integer>> 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
class Scratch { | |
public static TreeNode bst(TreeNode root, int key) { | |
System.out.print(root.val + " -> "); | |
if (root == null || root.val == key) { | |
return root; | |
} | |
if (root.val > key) { |