Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *Omar Natour 11/30/16
- * Csc-220 Data Structures
- * Hw8 Spell checker
- * create a program that can check words against a created dictionary class
- * ojnatour0001@student.stcc.edu
- */
- package chapter24;
- import chapter24.MyLinkedList.Node;
- public class MostRecentlyUsedLinkedList<E extends String> extends MyLinkedList<E> {
- public boolean contains(E e) {
- Node<E> current = this.head;
- while (current != null) {
- if (e.equalsIgnoreCase(current.element)) {
- this.remove(current.element);
- this.addFirst(current.element);
- return true;
- }
- current = current.next;
- }
- return false;
- }
- }
Add Comment
Please, Sign In to add comment