weidagang2046的專欄

          物格而后知致
          隨筆 - 8, 文章 - 409, 評論 - 101, 引用 - 0
          數(shù)據(jù)加載中……

          微軟筆試題max subsequence sum

          標(biāo)  題: 微軟筆試題max subsequence sum
          發(fā)信站: 飲水思源 (2005年11月07日11:05:23 星期一)

          You are given an array of numbers which could be positive and negative. Please
          write down a function to return the max subsequence sum from it.
          Note: The sequence could start from any number within the array.
          Sample: Array: -1, 7, -2, 5, -3
          The max subsequence sum should be 10, by the subsequence 7, -2, 5.
          大家討論一下,有哪些時(shí)間復(fù)雜度最低的算法。
          --

          ※ 來源:·飲水思源 bbs.sjtu.edu.cn·[FROM: 219.228.107.45]

          [回復(fù)本文] 發(fā)信人: BSR(bsr), 信區(qū): Algorithm
          標(biāo)  題: Re: 微軟筆試題max subsequence sum
          發(fā)信站: 飲水思源 (2005年11月07日12:27:18 星期一), 轉(zhuǎn)信
          
          job 前天討論過了 
          o(n) 即可 
          
          
          【 在 oceanist (oceanist) 的大作中提到: 】
          : You are given an array of numbers which could be positive and negative. Please
          :  write down a function to return the max subsequence sum from it.
          : Note: The sequence could start from any number within the array.
          : Sample: Array: -1, 7, -2, 5, -3
          : The max subsequence sum should be 10, by the subsequence 7, -2, 5.
          : 大家討論一下,有哪些時(shí)間復(fù)雜度最低的算法。
          

          posted on 2005-11-08 22:11 weidagang2046 閱讀(951) 評論(1)  編輯  收藏 所屬分類: Others

          評論

          # re: 微軟筆試題max subsequence sum[未登錄]  回復(fù)  更多評論   

          O(n)
          2008-01-20 10:37 | liu
          主站蜘蛛池模板: 封丘县| 庆元县| 哈密市| 华蓥市| 四子王旗| 翁牛特旗| 平潭县| 宜兰县| 华容县| 根河市| 江达县| 建阳市| 福贡县| 鄂伦春自治旗| 深圳市| 丽江市| 咸宁市| 伊金霍洛旗| 越西县| 板桥市| 沭阳县| 阿鲁科尔沁旗| 汨罗市| 冷水江市| 武宣县| 武陟县| 鹤峰县| 三门峡市| 江达县| 安乡县| 韶关市| 孝感市| 彭泽县| 叶城县| 罗定市| 云林县| 册亨县| 高碑店市| 中阳县| 商河县| 轮台县|