ให้หา max sum ของ sub-array

  • warning: realpath() [function.realpath]: SAFE MODE Restriction in effect. The script whose uid is 1005 is not allowed to access /tmp owned by uid 0 in /var/www/sites/sugree/codenone.com/subdomains/www/html/includes/file.inc on line 190.
  • warning: realpath() [function.realpath]: SAFE MODE Restriction in effect. The script whose uid is 1005 is not allowed to access /tmp owned by uid 0 in /var/www/sites/sugree/codenone.com/subdomains/www/html/includes/file.inc on line 190.

ได้โจทย์มา 2 ข้อ

1. Given an array of integers, find the sub-array with maximum sum. For example:
array: [-1, 2, 5, -1, 3, -2, 1]
maximum sub-array: [2, 5, -1, 3]

2. Given a matrix of integers, find the rectangle with maximum sum.

รับผิดชอบด้วย :P

ลองหัดทำข้อ 1 ด้วย haskell
http://pphetra.blogspot.com/2007/07/max-sum-sub-array.html

ตอบข้อแรกเป็น ML ไว้ที่
http://www.codenone.com/node/407
นะครับ

veer's picture

ใช้ scheme แต่ไม่แน่ใจว่าเขียนถูกหรือเปล่า :-P http://www.codenone.com/node/458
---
http://openil.wordpress.com/

ย้าย Codenone

ประกาศย้าย Codenone ไปใช้ Forum ของ Blognone แทนครับ ตามไปตั้งกระทู้ต่อได้ที่ Codenone Forum (รายละเอียดอ่านจากกระทู้ ย้าย Codenone ไปรวมกับ Blognone)

กระทู้เก่าๆ จะย้ายตามไปในภายหลัง ตอนนี้ปิดการโพสต์กระทู้ไว้ เหลือไว้เฉพาะอ้างอิงเท่านั้น