常见算法 - 链表相关:将链表的尾节点移动到最前位置n次

将链表的尾节点移动到头结点处,再完成后的链表再执行该操做,共执行n次。java Input: 0->1->2->NULL, k = 4 Output: Explanation: rotate 1 steps to the right: 2->0->1->NULL rotate 2 steps to the right: 1->2->0->NULL rotate 3 steps to the ri
相关文章
相关标签/搜索