Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void promeni_lista(SLL<Integer> lista, int x) {
- SLLNode<Integer> d1 = lista.getFirst();
- SLLNode<Integer> prev = null;
- if (d1 != null && d1.element == x) {
- d1 = d1.succ;
- }
- while (d1 != null && d1.element != x) {
- prev = d1;
- d1 = d1.succ;
- }
- if (d1 == null) {
- return;
- }
- prev.succ = d1.succ;
- System.out.println(lista.toString());
- }
Add Comment
Please, Sign In to add comment