题目描述: 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
分类:
编程语言 时间:
2016-03-06 17:12:08
阅读次数:
164
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2612 BFS搜索 目标地 并记录下来 之后再判断两段路程之和 代码: 1 #include <stdio.h> 2 #include <string.h> 3 #include <math.h> 4 #
分类:
其他好文 时间:
2016-03-06 17:11:30
阅读次数:
162
Given a non-empty binary search tree and a target value, find k values in the BST that are closest to the target. Note: Given target value is a floati
分类:
其他好文 时间:
2016-03-06 15:30:11
阅读次数:
385
The Sum of the k-th Powers There are well-known formulas: , , . Also mathematicians found similar formulas for higher degrees. Find the value of the s
分类:
其他好文 时间:
2016-03-06 12:57:11
阅读次数:
213
原题链接在这里:https://leetcode.com/problems/range-sum-query-mutable/ 题目: Given an integer array nums, find the sum of the elements between indices i and j (
分类:
其他好文 时间:
2016-03-06 06:39:48
阅读次数:
186
Question: Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never orde
分类:
数据库 时间:
2016-03-05 21:53:33
阅读次数:
175
Ugly Number II:Write a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1...
分类:
其他好文 时间:
2016-03-05 20:31:38
阅读次数:
191
Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2. Your algorithm s
分类:
其他好文 时间:
2016-03-05 20:21:26
阅读次数:
135
1. 每个元素可用多次 Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The
分类:
其他好文 时间:
2016-03-05 19:00:31
阅读次数:
183
You’re given k arrays, each array has k integers. There are k
k ways to pick exactly one element in each
array and calculate the sum of the integers. Your task is to find the k smallest sums among them....
分类:
其他好文 时间:
2016-03-05 14:48:36
阅读次数:
134