Skip to content

Instantly share code, notes, and snippets.

View divyakali's full-sized avatar

Divya divyakali

View GitHub Profile

Keybase proof

I hereby claim:

  • I am divyakali on github.
  • I am dranga (https://keybase.io/dranga) on keybase.
  • I have a public key ASC7SdjOyTSm8BP8DNCDQfq-XXckdGwGLWaChQkOSq_e-go

To claim this, I am signing this object:

@divyakali
divyakali / Isomorphism.java
Last active August 30, 2015 18:41
Checks if two strings are isomorphic i.e if the characters in source can be replaced to transform into target. The oder should be preserved. Characters can map to themselves but two different characters cannot map to the same character.Checks if two strings are isomorphic i.e if the characters in source can be replaced to transform into target. …
import java.util.HashMap;
public class Isomorphism {
/**
* Checks if two strings are isomorphic
*/
public static boolean isIsomorphic(String source, String target) {
if (source == null || target == null)
@divyakali
divyakali / GraphNode.java
Created August 2, 2015 19:07
Graph Traversals
public class GraphNode{
int vertex;
ArrayList<Integer> edges = new ArrayList<Integer>();
public GraphNode(int vertex,ArrayList<Integer> edges){
this.vertex = vertex;
this.edges = edges;
}
public ArrayList<Integer> getEdges(){return edges;}
public String toString(){