Reversing a singly-linked list in Java ..
Dec 27, 2009 by techfox9 in Algorithms, Java
Author: techfox9
Dec 27, 2009 in Algorithms, Java
From http://www.informatics.susx.ac.uk/courses/dats/notes/html/node46.html
public void reverse(ListNode head) {
ListNode current = head;
head = null;
ListNode save = null;
while (current != null) {
save = current;
current = current.next;
save.next = head;
head = save;
}
}
Dec 27, 2009 by techfox9 in Algorithms, Java
Dec 02, 2009 by techfox9 in Algorithms, Java
Oct 28, 2009 by techfox9 in Eclipse, Uncategorized
Oct 22, 2009 by techfox9 in Uncategorized
Sep 16, 2009 by techfox9 in Subversion