Added 27 solutions

This commit is contained in:
rshaghoulian
2017-03-05 00:26:42 -06:00
parent af8c2969a4
commit 3a6797a94a
43 changed files with 2823 additions and 598 deletions
@@ -0,0 +1,22 @@
// Author: Rodney Shaghoulian
// Github: github.com/rshaghoulian
// HackerRank: hackerrank.com/rshaghoulian
/*
class Node {
public int frequency; // the frequency of this tree
public char data;
public Node left, right;
}
*/
void decode(String str, Node root) {
Node n = root;
for (int i = 0; i < str.length(); i++) {
n = str.charAt(i) == '0' ? n.left : n.right;
if (n.left == null && n.right == null) {
System.out.print(n.data);
n = root;
}
}
}