- 博客(25)
- 收藏
- 关注
原创 leetcode Palindrome Linked List 链表
Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?Show TagsShow Similar Problems题目意思是给一个链表,判断是不是回文,比如1->2->3->
2015-07-14 15:58:14 293
原创 leetcode Fraction to Recurring Decimal 哈希表
leetcode Fraction to Recurring Decimal 哈希表
2015-07-14 13:12:26 424
原创 leetcode Two Sum 哈希表
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, where
2015-07-06 19:12:27 311
原创 leetcode Contains Duplicate II 哈希表
Given an array of integers and an integer k, find out whether there there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between iand j is at most k.
2015-07-06 17:27:09 429
原创 leetcode Flatten Binary Tree to Linked List树
leetcode Flatten Binary Tree to Linked List树
2015-07-06 16:54:27 318
原创 leetcode Power of Two位运算
Given an integer, write a function to determine if it is a power of two.Credits:Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases.Show Tags
2015-07-06 11:27:41 287
原创 leetcode Populating Next Right Pointers in Each Node 树 队列应用
leetcode Populating Next Right Pointers in Each Node 树 队列应用
2015-07-06 11:05:42 336
原创 leetcode Sum Root to Leaf Numbers 树
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which represents the number 123.Find the tota
2015-07-06 09:57:18 307
转载 Longest Substring Without Repeating Characters求最长子串中没有重复字母的最长长度
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo
2015-07-06 09:37:39 354
原创 leetcode Convert Sorted Array to Binary Search Tree 树
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.把一个有序的数组编程平衡二叉搜索树。/** * Definition for a binary tree node. * struct TreeNode { * int val; *
2015-07-05 22:58:54 287
原创 leetcode Symmetric Tree 树
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the f
2015-07-05 19:47:07 219
原创 leetcode Minimum Depth of Binary Tree
Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node./** * Definition for a binary tre
2015-07-05 17:45:46 247
原创 leetcode Balanced Binary Tree 树
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diffe
2015-07-05 17:10:47 250
原创 leetcode Remove Nth Node From End of List 链表 双指针
leetcode Remove Nth Node From End of List 链表 双指针
2015-07-02 10:18:34 332
原创 leetcode Minimum Size Subarray Sum 双指针
leetcode Minimum Size Subarray Sum 双指针
2015-07-02 09:48:23 452
原创 leetcode Binary Tree Zigzag Level Order Traversal 层序遍历 双队列
双队列实现二叉树的层序遍历。
2015-07-01 19:08:02 372
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人