程序媛詹妮弗
终身学习
摘要: 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 程序媛詹妮弗 阅读(174) 评论(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 程序媛詹妮弗 阅读(93) 评论(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 程序媛詹妮弗 阅读(166) 评论(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 程序媛詹妮弗 阅读(176) 评论(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 程序媛詹妮弗 阅读(137) 评论(0) 推荐(0) 编辑