变形
文章平均质量分 65
jmspan
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode 232. Implement Queue using Stacks(用栈实现队列)
原题网址:https://leetcode.com/problems/implement-queue-using-stacks/ mplement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue.pop() -- Removes the原创 2016-04-05 11:53:58 · 560 阅读 · 0 评论 -
HackerRank [Algo] Matrix Rotation
原题网址:https://www.hackerrank.com/challenges/matrix-rotation-algo You are given a 2D matrix, a, of dimension MxN and a positive integer R. You have to rotate the matrix R times and print th原创 2016-06-26 13:09:39 · 764 阅读 · 0 评论 -
LeetCode 324. Wiggle Sort II(摇摆排序)
原题网址:https://leetcode.com/problems/wiggle-sort-ii/ Given an unsorted array nums, reorder it such that nums[0] nums[2] . Example: (1) Given nums = [1, 5, 1, 1, 6, 4], one possible answer is原创 2016-06-05 00:58:45 · 1500 阅读 · 0 评论 -
LeetCode 48. Rotate Image(旋转)
原题网址:https://leetcode.com/problems/rotate-image/ You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place?原创 2016-05-21 05:34:52 · 436 阅读 · 0 评论 -
LeetCode 24. Swap Nodes in Pairs(交换节点)
原题网址:https://leetcode.com/problems/swap-nodes-in-pairs/ Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2-原创 2016-05-19 07:29:56 · 402 阅读 · 0 评论 -
LeetCode 234. Palindrome Linked List(对称链表)
原题网址:https://leetcode.com/submissions/detail/58253344/ Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space? 思路:普通的思路是可以生成一个反转的原创 2016-04-06 05:36:23 · 1027 阅读 · 0 评论 -
LeetCode 226. Invert Binary Tree(反转二叉树)
原题网址:https://leetcode.com/problems/invert-binary-tree/ Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 思路:递归调用,对左右子节原创 2016-04-05 03:54:25 · 928 阅读 · 0 评论 -
LeetCode 143. Reorder List(重组链表)
原题网址:https://leetcode.com/problems/reorder-list/ Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' va原创 2016-05-26 02:08:26 · 1603 阅读 · 0 评论 -
LeetCode 153. Find Minimum in Rotated Sorted Array(旋转数组查找)
原题网址:https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/ Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7原创 2016-05-26 01:02:22 · 477 阅读 · 0 评论 -
LeetCode 114. Flatten Binary Tree to Linked List(摊平二叉树)
原题网址:https://leetcode.com/problems/flatten-binary-tree-to-linked-list/ Given a binary tree, flatten it to a linked list in-place. For example, Given 1 / \ 2 5原创 2016-05-24 00:19:26 · 542 阅读 · 0 评论 -
LeetCode 156. Binary Tree Upside Down(树的倒转)
原题网址:https://leetcode.com/problems/binary-tree-upside-down/ Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or em原创 2016-05-26 00:48:19 · 923 阅读 · 0 评论
分享