GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Algorithm/java/coding/reverseListRecursive.java at master · lelea2/Algorithm Expand file tree/ Copy pathreverseListRecursive.javaMore file actions 22 lines (20 loc) · 572 Bytes / Copy pathreverseListRecursive.javaFile metadata and controls22 lines (20 loc) · 572 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 /** * Function to reverse list recursively */ public void recursiveReverse(Node currentNode) { //check for empty list if(currentNode == NULL) { return; } /* if we are at the TAIL node: recursive base case: */ if(currentNode.next == NULL) { //set HEAD to current TAIL since we are reversing list head = currentNode; return; //since this is the base case } recursiveReverse(currentNode.next); currentNode.next.next = currentNode; currentNode.next = null; //set "old" next pointer to NULL } |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |