Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Download: http://solutionzip.com/downloads/java-programs/
- 1)Use recursion to implement a method boolean find(String t) that tests whether a
- string is contained in a sentence:
- Sentence s = new Sentence(“Mississippi!”);
- boolean b = s.find(“sip”); // Returns true
- Hint: If the text starts with the string you want to match, then you are done. If not,
- consider the sentence that you obtain by removing the ?rst character.
- 2)Use recursion to implement a method boolean find(String t) that tests whether a
- string is contained in a sentence:
- Sentence s = new Sentence(“Mississippi!”);
- boolean b = s.find(“sip”); // Returns true
- Hint: If the text starts with the string you want to match, then you are done. If not,
- consider the sentence that you obtain by removing the ?rst character.
- 3)Using only the public interface of the linked list class, write a method
- public static void downsize(LinkedList staff)
- that removes every other employee from a linked list.
- 4)The standard Java library implements a Stack class, but in this exercise you are asked
- to provide your own implementation. Do not implement type parameters. Use an
- Object[] array to hold the stack elements. When the array ?lls up, allocate an array
- of twice the size and copy the values to the larger array
- 5)Implement a Stack class by using a linked list to store the elements. Do not implement type parameters
- Download: http://solutionzip.com/downloads/java-programs/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement