leetcode
DevinDujun
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Leetcode刷题-merged two sorted list
题目:merged two sorted list 描述 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: Input: 1->2->...原创 2019-02-01 15:01:55 · 233 阅读 · 0 评论 -
leetcode-rotate-list
rotate-list 描述 Given a linked list, rotate the list to the right by k places, where k is non-negative. Example 1: Input: 1->2->3->4->5->NULL, k = 2 Output: 4->5->1->2->3-&...原创 2019-02-20 14:06:10 · 287 阅读 · 0 评论 -
leetcode-partition-list
partition-list 描述 Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the...原创 2019-02-20 13:41:46 · 261 阅读 · 0 评论 -
leetcode-remove duplicates from sorted list
remove duplicates from sorted list 描述 Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Example 1: Input: 1->2->3-...原创 2019-02-19 21:07:57 · 265 阅读 · 0 评论 -
leetcode-swap nodes in pairs
swap nodes in pairs 描述 Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list’s nodes, only nodes itself may be changed. Example: Given 1-&...原创 2019-02-18 22:05:50 · 211 阅读 · 0 评论 -
leetcode-Remove Nth Node From End of List
Remove Nth Node From End of List 描述 Given a linked list, remove the n-th node from the end of list and return its head. Example: Given linked list: 1->2->3->4->5, and n = 2. After removin...原创 2019-02-18 21:27:31 · 196 阅读 · 0 评论 -
leetcode-middle-of-the-linked-list
middle-of-the-linked-list 描述 Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second middle node Example 1: I...原创 2019-02-18 20:28:45 · 245 阅读 · 0 评论 -
leetcode-链表-Palindrome Linked List
Palindrome Linked List 描述 Given a singly linked list, determine if it is a palindrome. Example 1: Input: 1->2 Output: false Example 2: Input: 1->2->2->1 Output: true 思路 1.翻转链表,逐一比较 (占...原创 2019-02-16 23:21:04 · 240 阅读 · 0 评论 -
leetcode-reverse linked list
题目 reverse linked list 描述 Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL 解法 c++ 慢慢原创 2019-02-02 20:21:11 · 229 阅读 · 0 评论 -
leetcode -remove linked list elements
题目 remove linked list elements 描述 Remove all elements from a linked list of integers that have value val. Example: Input: 1->2->6->3->4->5->6, val = 6 Output: 1->2-&am原创 2019-02-01 21:58:49 · 243 阅读 · 0 评论 -
leetcode - intersection oftwo Linked Lists
题目 描述 Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to intersect at node c1. Example 1: Input: inter...原创 2019-02-01 21:07:07 · 226 阅读 · 0 评论 -
leetcode- Linked List cycle
题目 Linked List cycle 描述 Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the l...原创 2019-02-01 19:19:17 · 251 阅读 · 0 评论 -
leetcode刷题remove duplicates from sorted list
题目: remove duplicates from sorted list 描述 Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Input: 1->1->2 Output: 1->2 Example 2: Input:原创 2019-02-01 18:29:26 · 292 阅读 · 0 评论 -
leetcode-reverse-linked-list-ii
reverse-linked-list-ii 描述 Reverse a linked list from position m to n. Do it in one-pass. Note: 1 ≤ m ≤ n ≤ length of list. Example: Input: 1->2->3->4->5->NULL, m = 2, n = 4 Output: 1-...原创 2019-02-20 15:08:19 · 216 阅读 · 0 评论
分享