Proseminar | |
Programming Pearls | |
Algorithm Design Techniques | |
von Andreas Lenerz | |
Beispiel zu Algorithmus A5
Das Beispiel zeigt zusätzlich die Wertebelegung von max_so_far und max_ending_here an, um ein besseres Verständnis zu ermöglichen.
Initial haben max_so_far und max_ending_here die Belegung 0
i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
x[i] | 31 | -41 | 59 | 26 | -53 | 58 | 97 | -23 |
max_ending_here | 31 | 0 | 59 | 75 | 22 | 80 | 187 | 164 |
max_so_far | 31 | 31 | 59 | 75 | 75 | 80 | 187 | 187 |