Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void removeDuplicate(SLL<Integer> lista) {
- SLLNode<Integer> d1 = lista.getFirst();
- SLLNode<Integer> tmp = null;
- while (d1 != null) {
- tmp = d1;
- while (tmp != null && tmp.element.equals(d1.element)) {
- tmp = tmp.succ;
- }
- d1.succ = tmp;
- d1 = d1.succ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement