摘要:
Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 题意: 给定一个链表,判断是否循环 思路: 快慢指针 若有环,则快慢指针一定会在 阅读全文
摘要:
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 preserve the 阅读全文
摘要:
Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Example 2: 题意: 有序链表去重 思路: 代码: 阅读全文
摘要:
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 empty, flip it up 阅读全文
摘要:
Reverse a singly linked list. Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 题意: 如题 思路: 无 代码: 阅读全文