public void reverse3 () { myHead = reverse3Helper (myHead); } public static ListNode reverse3Helper (ListNode head){ ListNode p, soFar; for (p = head, soFar = null; p != null;){ ListNode temp = p.myRest; p.myRest = soFar; soFar = p; p = temp; } return soFar; }
Sunday, November 18, 2007
Subscribe to:
Post Comments (Atom)
Just some daily notes ...
Things I'm into now...
Blog Archive
-
▼
2007
(29)
-
▼
November
(14)
- Declaring an Edge Adjacency List Graph
- MaximallyBalanced or Complete Binary Tree
- Calculating the Height of a Tree
- Adding to a Circular Doubly Linked List
- 3 ways to REVERSE a list (singly linked)
- Reversing a List Iteratively!
- Doubling a Linked List
- Access Modifiers: public, private, proctecd, packa...
- End of HFJ
- Format Specifiers
- Collection class tidbits...
- Generic class definitions and one implementation
- doubling a List
- Don't Forget Your Scheme!
-
▼
November
(14)
No comments:
Post a Comment