![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
链表
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 · 361 阅读 · 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 · 363 阅读 · 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 · 223 阅读 · 1 评论