![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法题
昨夜听风
JAVA WEB
展开
-
[leetcode]112. Path Sum
题目描述:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example: Given the below binary tree and su原创 2017-01-05 14:47:52 · 184 阅读 · 0 评论 -
[leetCode]118_Pascal's Triangle
题目描述Given 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] ] 两层for循环——ArrayListpublic原创 2017-01-05 15:18:01 · 206 阅读 · 0 评论 -
[leetCode]119.Pascal's Triangle 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? 题目分析这题的难点在于满足空间复杂原创 2017-01-05 15:54:06 · 195 阅读 · 0 评论 -
[leetCode]119.Pascal's Triangle II
题目描述 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)原创 2017-01-05 16:14:12 · 226 阅读 · 0 评论 -
[leetCode]155. Min Stack
题目描述 Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) – Push element x onto stack. pop() – Removes the element on top of the stack. top() – Ge原创 2017-01-05 18:56:17 · 220 阅读 · 0 评论 -
[leetCode]160. Intersection of Two Linked Lists
题目描述 Write a program to find the node at which the intersection of two singly linked lists begins.求两链表的交点。原创 2017-01-05 19:30:41 · 185 阅读 · 0 评论 -
[leetCode]168. Excel Sheet Column Title
题目描述 Given a positive integer, return its corresponding column title as appear in an Excel sheet.求excel中的列数对应的列名。 解题思路 这题类比26进制。原创 2017-01-06 18:33:59 · 218 阅读 · 0 评论