[LeetCode]61.Rotate List

【题目】 Given a list, rotate the list to the right bykplaces, wherekis non-negative. For example: Given1->2->3->4->5->NULLandk=2, return4->5->1->2->3->NULL. 【题意】 给定一个链表,向右旋转k个位置,其中k是非负的。 【分析】 先遍历一遍,得出链表长
相关文章
相关标签/搜索