Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Counts how many strings in wordArray are not found in theVocab, as described
- * in
- * part (a).
- */
- public int countNotInVocab(String[] wordArray)
- {
- int count = 0;
- for(String w: wordArray) {
- if(!findWord(w)) {
- count++;
- }
- }
- return count;
- }
- /**
- * Returns an array containing strings from wordArray not found in theVocab,
- * as described in part (b).
- */
- public String[] notInVocab(String[] wordArray)
- {
- int c = countNotInVocab(wordArray);
- String result[] = new String[c];
- int count = 0;
- for(String w: wordArray) {
- if(!findWord(w)) {
- result[count++] = w;
- }
- }
- return result;
- }
- **************************************************
- Thanks for your question. We try our best to help you with detailed answers, But in any case, if you need any modification or have a query/issue with respect to above answer, Please ask that in the comment section. We will surely try to address your query ASAP and resolve the issue.
- Please consider providing a thumbs up to this question if it helps you. by Doing that, You will help other students, who are facing similar issue.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement