原题地址:https://oj.leetcode.com/problems/rotate-list/ 题意: Given a list, rotate the list to the right by k places, where k is non-negative. ...
题目: Given a list, rotate the list to the right by k places, where k is non negative. For example: Given gt gt gt gt gt NULL and k , return gt gt gt gt gt NULL. 题解: 这道题主要先理解题意,就是倒着数k个node,从那开始到结尾和之前那部 ...
2014-07-24 00:54 0 4560 推荐指数:
原题地址:https://oj.leetcode.com/problems/rotate-list/ 题意: Given a list, rotate the list to the right by k places, where k is non-negative. ...
题目: 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 ...
Given a list, rotate the list to the right by k places, where k is non-negative. For example:Given 1->2->3->4->5->NULL and k ...
题目: 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 ...
in place交换 如果是k步,那么就是把后面k个放到前面了嘛。 我们先把整个数组reverse,然后把前面的reverse回来,再把后面的reverse回来 对于AB我们要通过reve ...
原题地址:https://oj.leetcode.com/problems/rotate-image/ 题意: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees ...
题目: Sort a linked list in O(n log n) time using constant space complexity. 题解: 考虑到要求用O(nlogn)的时间复杂度和constant space complexity来sort list,自然而然想到 ...
Given an array of integers A and let n to be its length. Assume Bk to be an array obtained by ro ...