- 博客(13)
- 资源 (6)
- 收藏
- 关注
原创 【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 707
原创 【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 724
转载 39岁研究生毕业14年的经验和教训
不要遇到挫折就灰心,年轻人要时刻保持积极向上的态度.失败了,重来过;失去了,再争取别的。错过了,要分析,下次来,要把握;幼稚了,下次,成熟点。不要紧,会好的,哪怕到了极点,也不要放弃,相信一定可以挺过去。不要消极,会好的。曾经的错,过去了,总不能回味在过去。现在的,很好,累完了,很舒服。不要伤,总会有人在支撑你。
2017-03-08 17:02:53 2847 2
转载 【转载】浮华背后与我的路
IT行业和其他行业,根本没有什么本质的不同,入门门槛低了、人多了,自然要降价、要裁员。水位上涨时,为了避免被淹死,那就要逃到更高海拔的地方去,或者积极转向管理,或者果断换行、换地。
2017-03-08 16:45:25 746
原创 【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 406
原创 【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 433
原创 【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 349
原创 【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 384
原创 【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 / 3return [1,3,2].分析:
2017-03-07 10:20:42 373
原创 【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 491 1
原创 【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 451
原创 【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 563
mysql-connector-java-3.1.11-bin.jar
2013-07-02
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人