public static boolean checkAnagram(String parent, String query) {
        int i = 0;
        int j = 0;

        if (parent == null || query == null) {
            return false;
        }
        while (i < parent.length() && j < query.length()) {
            if (parent.indexOf(query.charAt(j)) < 0 || query.indexOf(parent.charAt(i)) < 0) {
                return false;
            }
            i++;
            j++;
        }
        return true;
    }// end of Check Anagram Method. the Big-Oh is O(n log n)