linkedlist
jyjkitty
这个作者很懒,什么都没留下…
展开
-
add 2 numbers
2. add 2 numbersYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbe原创 2017-07-05 22:36:18 · 194 阅读 · 0 评论 -
141 linked list cycle
linked list cycleGiven a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space?用tortoise and hare算法,一个快指针一个慢指针。代码块leetcode上的最优解法:# Definition for singl原创 2017-08-10 15:45:25 · 206 阅读 · 0 评论 -
Python学习 ——enumerate函数
237. Delete Node in a Linked ListWrite a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are giv原创 2017-08-11 12:52:19 · 246 阅读 · 0 评论