链表
dherorunner
光电信息科学专业,有志考研计算机。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
leetcode 判断简单链表是否存在循环
/* struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; */ class Solution { public: bool hasCycle(ListNode *head) { ListNode*原创 2017-03-28 20:45:57 · 447 阅读 · 0 评论 -
Delete Node in a Linked List 删除指针指向的元素
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: void deleteN原创 2017-03-28 21:08:32 · 460 阅读 · 0 评论 -
Merge Two Sorted List
ListNode *mergeTwoLists(ListNode *l1, ListNode *l2) { if(NULL == l1) return l2; if(NULL == l2) return l1; ListNode* head=NULL; // head of the list to return // find f原创 2017-03-30 22:36:05 · 298 阅读 · 1 评论
分享