
刷题
/*chen*/
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
leetcode刷题(141)——判断单链表是否有环
Given a linked list, determine if it has a cycle in it.To represent a cycle in the given linked list, we use an integerposwhich represents the position (0-indexed)in the linked list where tail c...原创 2019-04-25 11:26:05 · 879 阅读 · 0 评论 -
leetcode刷题(225)——用队列实现栈
Implement the following operations of a stack using queues.push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. top() -- Get the top element. empty() -- Return...原创 2019-04-29 16:51:09 · 428 阅读 · 0 评论 -
leetcode刷题(232)——用栈实现队列
Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue. pop() -- Removes the element from in front of queue. peek() -- Get the front element. e...原创 2019-04-29 17:34:13 · 316 阅读 · 0 评论 -
leetcode刷题(844)——回退字符串比较
Given twostringsSandT,return if they are equal when both are typed into empty text editors.#means a backspace character.Example 1:Input: S = "ab#c", T = "ad#c"Output: trueExplanation: B...原创 2019-04-29 22:39:54 · 452 阅读 · 0 评论 -
leetcode刷题(25)——k个结点一组反转单链表
Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.kis a positive integer and is less than or equal to the length of the linked list. If the number of...原创 2019-04-25 11:25:37 · 320 阅读 · 0 评论 -
leetcode刷题(20)——判断括号的有效性
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of ...原创 2019-04-26 09:34:13 · 717 阅读 · 0 评论 -
leetcode刷题(24)——成对反转单链表
Given alinked list, swap every two adjacent nodes and return its head.You maynotmodify the values in the list's nodes, only nodes itself may be changed.Example:Given 1->2->3->4 ...原创 2019-04-22 11:33:03 · 439 阅读 · 0 评论 -
leetcode刷题(206)——反转单链表
Reverse a singly linked list.Example:Input: 1->2->3->4->5->NULLOutput: 5->4->3->2->1->NULLFollow up:A linked list can be reversed either iteratively or recurs...原创 2019-04-15 16:48:01 · 342 阅读 · 0 评论 -
leetcode刷题(92)——指定范围反转单链表
Reverse a linked list from positionmton. Do it in one-pass.Note:1 ≤m≤n≤ length of list.Example:Input: 1->2->3->4->5->NULL, m = 2, n = 4Output: 1->4->3->2->5...原创 2019-04-17 11:05:16 · 421 阅读 · 0 评论 -
leetcode刷题(142)——判断单链表是否有环,如果有环,输出环起始位置索引
Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.To represent a cycle in the given linked list, we use an integerposwhich represents the position (0-...原创 2019-04-25 11:26:14 · 580 阅读 · 0 评论