public int add(String s, int c, int p) {
        char first = s.charAt(0);
        if (s.length() > 1) {
            for (Node child : children) {
                if (child.data == first) {
                    return child.add(s.substring(1), c++, this.code);
                }
            }
        } else if (s.length() == 1) {
            for (Node child : children) {
                if (child.data == first) {
                    return child.code;
                }
            }
            Node n = new Node(first, c++, this.code);
            children.add(n);
            return c;
        }
        Node n = new Node(first, c++, this.code);
        children.add(n);
        if (s.length() > 1) {
            return n.add(s.substring(1), c++, this.code);
        }
        return c;
    }