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 — tech-code-interview/reverse-linked-list.py at master · BarthJr/tech-code-interview Expand file tree/ Copy pathreverse-linked-list.pyMore file actions 16 lines (14 loc) · 369 Bytes / Copy pathreverse-linked-list.pyFile metadata and controls16 lines (14 loc) · 369 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 # https://leetcode.com/problems/reverse-linked-list/ class ListNode: def __init__(self, val): self.val = val self.next = None def reverseList(head): previous = None current = head while current is not None: aux = current.next current.next = previous previous = current current = aux return previous |
| 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. |