
leetcode
文章平均质量分 58
复兴之矢
图像处理与模式识别
深度学习
云计算
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【leetcode】 subset I、II
【subset I】问题: Given a set of distinct integers, nums, return all possible subsets. Note: The solution set must not contain duplicate subsets. For example, If nums = [1,2,3], a原创 2017-03-08 10:40:04 · 494 阅读 · 0 评论 -
【leetcode】 merge two sorted list
问题: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 分析: 注意 p==nullptr 和 !p的不同; 代原创 2017-03-07 14:56:57 · 417 阅读 · 0 评论 -
【leetcode】Binary Tree Inorder Traversal
问题: Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree [1,null,2,3], 1 \ 2 / 3 return [1,3,2]. 分析:原创 2017-03-07 10:20:42 · 404 阅读 · 0 评论 -
【leetcode】 pow(x,n)
问题: Implement pow(x, n). 分析: 1、二分法:x^n = x^n/2 * x^n/2 ×*x^n%2。 代码: class Solution { public: double myPow(double x,int n){ //指数为负的情况: 倒数; if原创 2017-03-09 20:44:36 · 754 阅读 · 0 评论 -
【leetcode】sqrt
问题: Implement int sqrt(int x). Compute and return the square root of x. 分析: 1、二分法。 代码: class solution{ public: int sqrt(int x){ if(x原创 2017-03-09 20:16:51 · 781 阅读 · 0 评论 -
【leetcode】unique paths
【leetcode】 unique paths 动规解法原创 2017-03-09 10:18:46 · 579 阅读 · 0 评论 -
【leetcode】Longest Valid Parentheses
问题: Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the longest valid parentheses substring is原创 2017-03-05 17:15:59 · 536 阅读 · 1 评论 -
【leetcode】 word ladder
问题: Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence frombeginWord to endWord, such that: Only one let原创 2017-03-08 16:13:11 · 439 阅读 · 0 评论 -
【LeetCode】 Add Two Numbers
题目: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as原创 2017-03-04 15:21:38 · 605 阅读 · 0 评论 -
【leetcode】Implement strStr()
题目: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 分析: 看字符串needle是否是haystack的一部分。用暴力破解法。 代码:原创 2017-03-05 10:29:02 · 492 阅读 · 0 评论 -
【leetcode】search insert position
问题: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume no duplica原创 2017-03-07 19:16:07 · 376 阅读 · 0 评论