- 博客(14)
- 资源 (19)
- 问答 (1)
- 收藏
- 关注
原创 Leetcode#257. Binary Tree Paths(二叉树的所有路径)
题目Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["1->2->5", "1->3"]题意给你一个二叉树,输出所
2018-01-29 17:31:25 434
原创 Leetcode#111. 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.题意给你一个二叉树,找出他的最小的深度。 最小深度的定义为:从
2018-01-29 16:12:38 195
原创 Leetcode#110. 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 d
2018-01-29 15:35:36 259
原创 Leetcode#342. Power of Four(4次幂)
题目Given an integer (signed 32 bits), write a function to check whether it is a power of 4.Example: Given num = 16, return true. Given num = 5, return false.Follow up: Could you solve it without
2018-01-29 14:37:40 217
原创 Leetcode#326. Power of Three(3次幂)
题目Given an integer, write a function to determine if it is a power of three.Follow up: Could you do it without using any loop / recursion? 题意判断一个整数是不是3的次幂(不使用任何循环/递归)题解利用对数求解 log3(n)
2018-01-29 14:12:19 428
原创 Leetcode#231. Power of Two(2次幂)
题目Given an integer, write a function to determine if it is a power of two. 题意给你一个整数,判读是否是2的幂次方。题解解法一:简单解法1.特殊考虑1和0 2.一个数除2无非就有两个结果: (1)能除尽,除不尽 (2)能除尽: 商为1(最后一步,2/2=
2018-01-29 13:00:27 256
原创 Leetcode#176. Second Highest Salary(第二高薪水 - SQL语句)
题目Write a SQL query to get the second highest salary from the Employee table.+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 || 3 | 300 |+----+--------+For e
2018-01-27 17:46:57 1312 1
原创 Leetcode#171. Excel Sheet Column Number(Excel表列号--进制转换)
题目Related to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A -> 1 B -> 2 C -> 3 ...
2018-01-27 17:34:37 275
原创 Leetcode#168. Excel Sheet Column Title(Excel表列名--进制转换)
题目Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB 题意
2018-01-27 17:19:18 252
原创 Leetcode#125. Valid Palindrome(合法的回文串)
题目Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car” is not
2018-01-27 14:50:58 229
原创 Leetcode#122. Best Time to Buy and Sell Stock II(股票多次买卖的最佳时间--贪心)
题目Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy
2018-01-26 17:26:21 279 1
原创 Leetcode#121. Best Time to Buy and Sell Stock(股票一次买卖的最佳时期---动态规划)
题目Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock
2018-01-26 16:18:40 267
原创 Leetcode#119. Pascal's Triangle II(杨辉三角II)
题目Given an index k, return the kth row of the Pascal’s triangle.For example, given k = 3, Return [1,3,3,1].Note: Could you optimize your algorithm to use only O(k) extra space? 题意给你一个下标k
2018-01-24 20:39:19 209
原创 Leetcode#118. Pascal's Triangle(杨辉三角I)
118. Pascal’s TriangleGiven numRows, generate the first numRows of Pascal’s triangle.For example, given numRows = 5, Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]解法
2018-01-24 19:37:26 273
mysql-connector-java-5.1.25.zip
2017-10-15
简单员工管理系统
2017-03-19
TA创建的收藏夹 TA关注的收藏夹
TA关注的人