LeetCode --- 146. LRU Cache Apr 10, 2015

 Tags LeetCode , C++ , 数据结构

题目链接:LRU CacheDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the val... More »

0条评论

LeetCode --- 145. Binary Tree Postorder Traversal Apr 9, 2015

 Tags LeetCode , C++ , ,

题目链接:Binary Tree Postorder TraversalGiven a binary tree, return the postorder traversal of its nodes’ values.For example:Given binary tree {1,#,2,3}, 1 \ 2 ... More »

0条评论

LeetCode --- 144. Binary Tree Preorder Traversal Apr 8, 2015

 Tags LeetCode , C++ , ,

题目链接:Binary Tree Preorder TraversalGiven a binary tree, return the preorder traversal of its nodes’ values.For example:Given binary tree {1,#,2,3}, 1 \ 2 ... More »

0条评论

LeetCode --- 143. Reorder List Apr 7, 2015

 Tags LeetCode , C++ , 链表

题目链接:Reorder ListGiven a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes’ values.For e... More »

0条评论

LeetCode --- 142. Linked List Cycle II Apr 3, 2015

 Tags LeetCode , C++ , 链表 , 双指针

题目链接:Linked List Cycle IIGiven a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra ... More »

0条评论

LeetCode --- 141. Linked List Cycle Apr 3, 2015

 Tags LeetCode , C++ , 链表 , 双指针

题目链接:Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?这道题的要求是判断一个链表中是否有环。设置两个指针fast和slow,初始... More »

0条评论

LeetCode --- 139. Word Break Apr 2, 2015

 Tags LeetCode , C++ , 动态规划

题目链接:Word BreakGiven a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For exa... More »

0条评论

LeetCode --- 138. Copy List with Random Pointer Apr 1, 2015

 Tags LeetCode , C++ , Hash表 , 位操作

题目链接:Copy List with Random PointerA linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Re... More »

0条评论

LeetCode --- 137. Single Number II Mar 31, 2015

 Tags LeetCode , C++ , Hash表 , 位操作

题目链接:Single Number IIGiven an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtim... More »

0条评论

LeetCode --- 136. Single Number Mar 31, 2015

 Tags LeetCode , C++ , Hash表 , 位操作

题目链接:Single NumberGiven an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complex... More »

0条评论