摘要:
Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 题意: 给定一个链表,判断是否循环 思路: 快慢指针 若有环,则快慢指针一定会在 阅读全文
posted @ 2018-06-26 06:48
程序媛詹妮弗
阅读(184)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2018-06-26 06:28
程序媛詹妮弗
阅读(99)
评论(0)
推荐(0)
摘要:
Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Example 2: 题意: 有序链表去重 思路: 代码: 阅读全文
posted @ 2018-06-26 06:22
程序媛詹妮弗
阅读(178)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2018-06-26 05:55
程序媛詹妮弗
阅读(186)
评论(0)
推荐(0)
摘要:
Reverse a singly linked list. Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 题意: 如题 思路: 无 代码: 阅读全文
posted @ 2018-06-26 04:39
程序媛詹妮弗
阅读(140)
评论(0)
推荐(0)
浙公网安备 33010602011771号