The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Dynamic programming by Michiel 2005-05-05 12:57:10
This is homework-related, but I've been trying to come up with something on and off for days now, and I can't find anything.

There's this tree you need in n pieces, each with length Ln. It costs x currency to saw a piece of length x in two pieces. Now, with all Ln known, I need a dynamic programming algorithm (saving information inbetween that can be used later) to calculate the minimum cost of the job.

I can't figure it out. As an example, we got the computation of a binomial coefficient. That I understood. You keep a table in memory, and add two cells each time. With this problem, I can't think of anything (table, array) to save that will help later on. All I can think of right now is exhaustive search.

Any hint would be appreciated.

Thanks!
[ Reply ]
  I'm William, and I'll be your assitant for this by williamashbless2005-05-05 15:48:54
    There's a bit of a timezone-difference. :) by Michiel2005-05-06 00:51:41
      Is that algorithm right? by ToLazyToThink2005-05-06 09:24:48
        Excelent point, but by Michiel2005-05-06 09:37:55
          I've replied in _today's_ thread. (n/t) by williamashbless2005-05-06 09:46:02

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)