由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - [合集] A question for a C++ interview question
相关主题
a[i]=i++面试问题
说c++不难的欢迎来看看这个问个best practice
[转载] 简单的题都不敢做了.这问题有没有好办法做?
问一道排序题目大家有什么UML工具推荐?
问一个简单问题的算法 (转载)longest common sequence可以正着求么?
TIJ上写错了?ip问题
问一个关于convex set的数学问题 (转载)怎么把 integer 转为 multi-byte integer format?
matlab怎么从文件中读取所需字符串?got a little c++ coding problem
相关话题的讨论汇总
话题: question话题: c++话题: wmbyhh话题: find话题: sequence
进入Programming版参与讨论
1 (共1页)
b***y
发帖数: 2799
1
☆─────────────────────────────────────☆
wmbyhh (wmbyhh) 于 (Wed Jul 16 16:32:01 2008) 提到:
Find the sequence of consecutive numbers that add up to a maximum (or
highest) total within the array. Write a function to find the sum and also
the start and end positions of the sequence. The solution should be of O(N)
time complexity.
For example if the array is (0, -1, 2, -1, 3, -1, 0), maximum sum would be 4
(= 2 + -1 + 3).
I can only figure out way of O(N^2), but how can it be done with O(N)?
☆───
1 (共1页)
进入Programming版参与讨论
相关主题
got a little c++ coding problem问一个简单问题的算法 (转载)
data structure for set of path in a graphTIJ上写错了?
Please help me take a look at the program问一个关于convex set的数学问题 (转载)
求String中递增子字符串的个数怎么解?要求O(nlogn)matlab怎么从文件中读取所需字符串?
a[i]=i++面试问题
说c++不难的欢迎来看看这个问个best practice
[转载] 简单的题都不敢做了.这问题有没有好办法做?
问一道排序题目大家有什么UML工具推荐?
相关话题的讨论汇总
话题: question话题: c++话题: wmbyhh话题: find话题: sequence