原文:Rotate List leetcode java

题目: 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 推荐指数:

查看详情

[leetcode]Rotate List @ Python

原题地址:https://oj.leetcode.com/problems/rotate-list/ 题意: Given a list, rotate the list to the right by k places, where k is non-negative. ...

Fri Jun 13 19:19:00 CST 2014 0 3260
Rotate Image leetcode java

题目: 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 ...

Sat Aug 02 17:09:00 CST 2014 0 2990
[LeetCode] Rotate List 旋转链表

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 ...

Sat Mar 21 21:49:00 CST 2015 2 10692
Partition List leetcode java

题目: 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 ...

Wed Jul 23 18:21:00 CST 2014 0 3863
[leetcode]Rotate Array

in place交换 如果是k步,那么就是把后面k个放到前面了嘛。 我们先把整个数组reverse,然后把前面的reverse回来,再把后面的reverse回来 对于AB我们要通过reve ...

Fri Feb 27 05:03:00 CST 2015 0 2047
[leetcode]Rotate Image @ Python

原题地址: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 ...

Sat Jun 07 01:03:00 CST 2014 0 3937
Sort List leetcode java

题目: Sort a linked list in O(n log n) time using constant space complexity. 题解: 考虑到要求用O(nlogn)的时间复杂度和constant space complexity来sort list,自然而然想到 ...

Sat Jul 26 10:51:00 CST 2014 0 4210
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM