Advertisement
akosiraff

Download JAVA Programs

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