The Power of Computing Algorithms - PowerPoint PPT Presentation

About This Presentation
Title:

The Power of Computing Algorithms

Description:

The Power of Computing Algorithms Daryle J. Serrant serrantd2008_at_my.fit.edu Debasis Mitra dmitra_at_cs.fit.edu Florida Institute of Technology – PowerPoint PPT presentation

Number of Views:78
Avg rating:3.0/5.0
Slides: 222
Provided by: Dary93
Learn more at: https://cs.fit.edu
Category:

less

Transcript and Presenter's Notes

Title: The Power of Computing Algorithms


1
The Power of Computing Algorithms
  • Daryle J. Serrant Past Undergraduate Student
  • Debasis Mitra dmitra_at_cs.fit.edu
  • Florida Institute of Technology
  • Computer Science

2
What is an Algorithm?
Cooking lt- Recipes Building construction lt- Blue
print Software lt- Algorithm
3
Example Problem 1 Best Return on a Stock
  • We have daily stock prices over a period
  • Gains as positive
  • Loss as negative
  • When should we have bought and when should we
    have sold

4
Problem Example 2 Maximum Customers visited in a
Store
  • Customers visited left every hour is tracked
  • Incoming number as positive
  • Leaving number as negative
  • Between which hours maximum customers were in
    the store

5
A Computing Problem Maximum Subsequence
  • What is common between the two examples?
  • Can you find the maximum sub-sequence
  • of the following numbers
  • 3, 4, -8, 1, 9, -2, 3, -1
  • Answer 1, 9, -2, 3 for the max sum 11.
  • Question How fast can we get the answer?
  • Answer Depends on the ALGORITHM!

6
The Workaholic Approach
  • Go over every possible subsequence
  • Day 1 Day 2, Day 1 Day 3, etc.
  • Find the subsequence with the largest sum.

Image Source http//www.grinningplanet.com/2003/w
orkaholics/joke-1704.htm/
7
Day 1 Day 1
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 3
Max Sum 3
Addition Counter 1
Maximum Subsequence Day 1
8
Day 1 Day 2
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3
Addition Counter 2
9
Day 1 Day 2
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 7
Max Sum 3
Addition Counter 3
Maximum Subsequence Day 1
Max Sum is now 7 and Maximum Subsequence is now
Day 1 - 2
10
Day 1 Day 3
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3
Addition Counter 4
11
Day 1 Day 3
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4
Addition Counter 5
12
Day 1 Day 3
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 - 8 -1
Max Sum 7
Addition Counter 6
Maximum Subsequence Day 1 - 2
No change
13
Day 1 Day 4
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3
Addition Counter 7
14
Day 1 Day 4
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4
Addition Counter 8
15
Day 1 Day 4
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8
Addition Counter 9
16
Day 1 Day 4
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1 0
Max Sum 7
Addition Counter 10
Maximum Subsequence Day 1 - 2
No changes
17
Day 1 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3
Addition Counter 11
18
Day 1 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4
Addition Counter 12
19
Day 1 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8
Addition Counter 13
20
Day 1 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1
Addition Counter 14
21
Day 1 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1 9 9
Max Sum 7
Addition Counter 15
Maximum Subsequence Day 1 - 2
Max Sum is now 9 and Maximum Subsequence is Day 1
Day 5
22
Day 1 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3
Addition Counter 16
23
Day 1 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4
Addition Counter 17
24
Day 1 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8
Addition Counter 18
25
Day 1 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1
Addition Counter 19
26
Day 1 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1 9
Addition Counter 20
27
Day 1 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1 9 2 7
Max Sum 9
Addition Counter 21
Maximum Subsequence Day 1 - 5
No change
28
Day 1 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3
Addition Counter 22
29
Day 1 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4
Addition Counter 23
30
Day 1 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8
Addition Counter 24
31
Day 1 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1
Addition Counter 25
32
Day 1 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1 9
Addition Counter 26
33
Day 1 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1 9 2
Addition Counter 27
34
Day 1 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1 9 2 3 10
Max Sum 9
Addition Counter 28
Maximum Subsequence Day 1 - 5
Max Sum is now 10 and Maximum Subsequence is Day
1 - 7
35
Day 1 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3
Addition Counter 29
36
Day 1 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4
Addition Counter 30
37
Day 1 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8
Addition Counter 31
38
Day 1 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1
Addition Counter 32
39
Day 1 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1 9
Addition Counter 33
40
Day 1 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1 9 2
Addition Counter 34
41
Day 1 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1 9 2 3
Addition Counter 35
42
Day 1 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 4 8 1 9 2 3 1 9
Max Sum 10
Addition Counter 36
Maximum Subsequence Day 1 - 7
No changes
43
Day 2 Day 2
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 4
Max Sum 10
Addition Counter 37
Maximum Subsequence Day 1 - 7
No changes
44
Day 2 Day 3
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4
Addition Counter 38
45
Day 2 Day 3
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 -4
Max Sum 10
Addition Counter 39
Maximum Subsequence Day 1 - 7
No changes
46
Day 2 Day 4
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4
Addition Counter 40
47
Day 2 Day 4
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8
Addition Counter 41
48
Day 2 Day 4
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 1 -3
Max Sum 10
Addition Counter 42
Maximum Subsequence Day 1 - 7
No changes
49
Day 2 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4
Addition Counter 43
50
Day 2 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8
Addition Counter 44
51
Day 2 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 1
Addition Counter 45
52
Day 2 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 1 9 6
Max Sum 10
Addition Counter 46
Maximum Subsequence Day 1 - 7
No changes
53
Day 2 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4
Addition Counter 47
54
Day 2 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8
Addition Counter 48
55
Day 2 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 1
Addition Counter 49
56
Day 2 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 1 9
Addition Counter 50
57
Day 2 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 1 9 2 4
Max Sum 10
Addition Counter 51
Maximum Subsequence Day 1 - 7
No changes
58
Day 2 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4
Addition Counter 52
59
Day 2 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8
Addition Counter 53
60
Day 2 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 1
Addition Counter 54
61
Day 2 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 1 9
Addition Counter 55
62
Day 2 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 7 1 9 2
Addition Counter 56
63
Day 2 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 1 9 2 3 7
Max Sum 10
Addition Counter 57
Maximum Subsequence Day 1 - 7
No changes
64
Day 2 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4
Addition Counter 58
65
Day 2 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8
Addition Counter 59
66
Day 2 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 1
Addition Counter 60
67
Day 2 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 1 9
Addition Counter 61
68
Day 2 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 1 9 2
Addition Counter 62
69
Day 2 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 1 9 2 3
Addition Counter 63
70
Day 2 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 8 1 9 2 3 1 6
Max Sum 10
Addition Counter 64
Maximum Subsequence Day 1 - 7
No changes
71
Day 3 Day 3
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 -8
Max Sum 10
Addition Counter 65
Maximum Subsequence Day 1 - 7
No changes
72
Day 3 Day 4
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 -8
Addition Counter 66
73
Day 3 Day 4
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1 -7
Max Sum 10
Addition Counter 67
Maximum Subsequence Day 1 - 7
No changes
74
Day 3 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 -8
Addition Counter 68
75
Day 3 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1
Addition Counter 69
76
Day 3 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1 9 2
Max Sum 10
Addition Counter 70
Maximum Subsequence Day 1 - 7
No changes
77
Day 3 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8
Addition Counter 71
78
Day 3 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1
Addition Counter 72
79
Day 3 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1 9
Addition Counter 73
80
Day 3 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1 9 2 0
Max Sum 10
Addition Counter 74
Maximum Subsequence Day 1 - 7
No changes
81
Day 3 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8
Addition Counter 75
82
Day 3 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1
Addition Counter 76
83
Day 3 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1 9
Addition Counter 77
84
Day 3 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1 9 2
Addition Counter 78
85
Day 3 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1 9 2 3 3
Max Sum 10
Addition Counter 79
Maximum Subsequence Day 1 - 7
No changes
86
Day 3 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8
Addition Counter 80
87
Day 3 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1
Addition Counter 81
88
Day 3 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1 9
Addition Counter 82
89
Day 3 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1 9 2
Addition Counter 83
90
Day 3 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1 9 2 3
Addition Counter 84
91
Day 3 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 1 9 2 3 1 2
Max Sum 10
Addition Counter 85
Maximum Subsequence Day 1 - 7
No changes
92
Day 4 Day 4
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1 1
Max Sum 10
Addition Counter 86
Maximum Subsequence Day 1 - 7
No changes
93
Day 4 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1
Addition Counter 87
94
Day 4 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1 9 10
Max Sum 10
Addition Counter 88
Maximum Subsequence Day 1 - 7
No changes
95
Day 4 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1
Addition Counter 89
96
Day 4 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1 9
Addition Counter 90
97
Day 4 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1 9 2 8
Max Sum 10
Addition Counter 91
Maximum Subsequence Day 1 - 7
No changes
98
Day 4 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1
Addition Counter 92
99
Day 4 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1 9
Addition Counter 93
100
Day 4 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1 9 2
Addition Counter 94
101
Day 4 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1 9 2 3 11
Max Sum 10
Addition Counter 95
Maximum Subsequence Day 1 - 7
Max Sum is 11 and Maximum Subsequence is now Day
4 Day 7
102
Day 4 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1
Addition Counter 96
103
Day 4 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1 9
Addition Counter 97
104
Day 4 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1 9 2
Addition Counter 98
105
Day 4 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1 9 2 3
Addition Counter 99
106
Day 4 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1 9 2 3 1 10
Max Sum 11
Addition Counter 100
Maximum Subsequence Day 4 - 7
No changes
107
Day 5 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 9 9
Max Sum 11
Addition Counter 101
Maximum Subsequence Day 4 - 7
No changes
108
Day 5 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 9
Addition Counter 102
109
Day 5 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 9 2 7
Max Sum 11
Addition Counter 103
Maximum Subsequence Day 4 - 7
No changes
110
Day 5 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 9
Addition Counter 104
111
Day 5 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 9 2
Addition Counter 105
112
Day 5 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 9 2 3 10
Max Sum 11
Addition Counter 106
Maximum Subsequence Day 4 - 7
No changes
113
Day 5 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 9
Addition Counter 107
114
Day 5 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 9 2
Addition Counter 108
115
Day 5 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 9 2 3
Addition Counter 109
116
Day 5 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 9 2 3 1 9
Max Sum 11
Addition Counter 110
Maximum Subsequence Day 4 - 7
No changes
117
Day 6 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 2 -2
Max Sum 11
Addition Counter 111
Maximum Subsequence Day 1 - 7
No changes
118
Day 6 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 2
Addition Counter 112
119
Day 6 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 2 3 1
Max Sum 11
Addition Counter 113
Maximum Subsequence Day 4 - 7
No changes
120
Day 6 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 2
Addition Counter 114
121
Day 6 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 2 3
Addition Counter 115
122
Day 6 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 2 3 1 0
Max Sum 11
Addition Counter 116
Maximum Subsequence Day 4 - 7
No changes
123
Day 7 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 3
Max Sum 11
Addition Counter 117
Maximum Subsequence Day 4 - 7
No changes
124
Day 7 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3
Addition Counter 118
125
Day 7 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 1 2
Max Sum 11
Addition Counter 119
Maximum Subsequence Day 4 - 7
No changes
126
Day 8 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1 -1
Max Sum 11
Addition Counter 120
Maximum Subsequence Day 4 - 7
No changes
127
Analysis
  • Each sub-sequence between green red ptrs is
    aggregated, at most 8 addition counting
    operations per sub-sequence,
  • by using the black pointer
  • There is 32 subsequences in total
  • That is a lot of adding to do, dont you think?
  • Imagine having to find the maximum sub-sequence
    over100 days. Or, maybe 20,000 days.
  • Given n days of stock data, the number of
    addition operations that you will perform using
    the workaholic approach will be in the ballpark
    of around n3

128
Improve!
  • Do we really need to run the black/middle pointer
    over and over again on same numbers?
  • As the red/right pointer moves cannt we just add
    that number to the previous sum?

129
The Conservative Approach
  • The Workaholic approach requires a lot of
    addition operations
  • So much, that its impractical to use for large
    data sets
  • We can save a lot of time by using accumulated
    sums from the previous sub-sequences.
  • Let us call this the Conservative approach.

Photo source http//www.cosmeo.com/login.cfm?CFID
12472906CFTOKEN15878700
130
Day 1 Day 1
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 3
Max Sum 3
Maximum Subsequence Day 1 Day 1
Addition Counter 1
131
Day 1 Day 2
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 3 4 7
Max Sum 3
Maximum Subsequence Day 1 Day 1
Addition Counter 2
Max Sum is now 7 and Maximum Subsequence is Day 1
Day 2
132
Day 1 Day 3
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 7 8 -1
Max Sum 7
Maximum Subsequence Day 1 Day 2
Addition Counter 3
No changes
133
Day 1 Day 4
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum -1 1 0
Max Sum 7
Maximum Subsequence Day 1 Day 2
Addition Counter 4
No changes
134
Day 1 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 9 9
Max Sum 7
Maximum Subsequence Day 1 Day 2
Addition Counter 5
Max Sum is now 9 and Maximum Subsequence is Day 1
Day 5
135
Day 1 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 9 2 7
Max Sum 9
Maximum Subsequence Day 1 Day 5
Addition Counter 6
No changes
136
Day 1 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 7 3 10
Max Sum 9
Maximum Subsequence Day 1 Day 7
Addition Counter 7
Max Sum is now 10 and Maximum Subsequence is Day
1 Day 7
137
Day 1 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 10 1 9
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 8
No changes
138
Day 2 Day 2
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 4 4
Max Sum 11
Maximum Subsequence Day 1 Day 7
Addition Counter 9
No changes
139
Day 2 Day 3
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 4 8 -4
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 10
No changes
140
Day 2 Day 4
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum -4 1 -3
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 11
No changes
141
Day 2 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum -3 9 6
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 12
No changes
142
Day 2 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 6 2 4
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 13
No changes
143
Day 2 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 4 3 7
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 14
No changes
144
Day 2 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 7 1 6
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 15
No changes
145
Day 3 Day 3
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 8 8
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 16
No changes
146
Day 3 Day 4
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum -8 1 -7
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 17
No changes
147
Day 3 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum -7 9 2
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 18
No changes
148
Day 3 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 2 2 0
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 19
No changes
149
Day 3 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 3
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 20
No changes
150
Day 3 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 3 1 2
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 21
No changes
151
Day 4 Day 4
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1 1
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 22
No changes
152
Day 4 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 1 9 10
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 23
No changes
153
Day 4 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 10 2 8
Max Sum 10
Maximum Subsequence Day 1 Day 7
Addition Counter 24
No changes
154
Day 4 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 8 3 11
Max Sum 11
Maximum Subsequence Day 1 Day 7
Addition Counter 25
Max Sum is 11 and Maximum Subsequence is now Day
4 Day 7
155
Day 4 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 11 1 10
Max Sum 11
Maximum Subsequence Day 4 Day 7
Addition Counter 26
No changes
156
Day 5 Day 5
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 9 9
Max Sum 11
Maximum Subsequence Day 4 Day 7
Addition Counter 27
No changes
157
Day 5 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 9 2 7
Max Sum 11
Maximum Subsequence Day 4 Day 7
Addition Counter 28
No changes
158
Day 5 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 7 3 10
Max Sum 11
Maximum Subsequence Day 4 Day 7
Addition Counter 29
No changes
159
Day 5 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 10 1 9
Max Sum 11
Maximum Subsequence Day 4 Day 7
Addition Counter 30
No changes
160
Day 6 Day 6
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 2 -2
Max Sum 11
Maximum Subsequence Day 4 Day 7
Addition Counter 31
No changes
161
Day 6 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum -2 3 1
Max Sum 11
Maximum Subsequence Day 4 Day 7
Addition Counter 32
No changes
162
Day 6 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 1 1 0
Max Sum 11
Maximum Subsequence Day 4 Day 7
Addition Counter 33
No changes
163
Day 7 Day 7
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 3 3
Max Sum 11
Maximum Subsequence Day 4 Day 7
Addition Counter 34
No changes
164
Day 7 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 3 1 2
Max Sum 11
Maximum Subsequence Day 4 Day 7
Addition Counter 35
No changes
165
Day 8 Day 8
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
3
4
-8
1
9
-2
3
-1
Sum 0 1 -1
Max Sum 11
Maximum Subsequence Day 4 Day 7
Addition Counter 36
No changes
166
Some more Analysis
  • We are now only required to do 1 additional
    counting operation for each sub-sequence compared
    to at most 8 in the workaholic approach
  • For larger data sets, the number of addition
    operations will be in the ball park of around n2,
    where n is the size of the set.
  • Workaholic approach had this as n3

167
The Butchers Approach
  • The Conservative approach reduced the number of
    additions we needed to do by a factor of n.
  • This is good, but we can do even better than
    this.
  • Instead of solving the entire problem as a whole,
    how about cutting the problem down into smaller
    pieces that we can solve that doesnt require too
    much addition, solve those problems, and combine
    the results to get the final result.
  • Let us call this approach the Butchers approach.

Photo source http//www.reluctantgourmet.com/stea
k_information.htm
168
Combine results from smaller problems
Day 1
Day 2
Day 4
Day 5
Day 6
Day 7
Day 8
Day 3
3
4
-8
1
9
-2
3
-1
169
Solve Max Subsequence for Day 1 Day 4
Day 1
Day 2
Day 4
Day 5
Day 6
Day 7
Day 8
Day 3
3
4
-8
1
9
-2
3
-1
Left Max Sum (Day 1 Day 4) 7
Left Max Subsequence Day 1 Day 2
Addition Counter 9
170
Solve Max Subsequence for Day 5 Day 8
Day 1
Day 2
Day 4
Day 5
Day 6
Day 7
Day 8
Day 3
3
4
-8
1
9
-2
3
-1
Right Max Sum (Day 5 Day 8) 10
Left Max Sum (Day 1 Day 4) 7
Left Max Subsequence Day Day 2
Right Max Subsequence Day 5 Day 7
Addition Counter 18
171
Which side has the Largest Sum?
Day 1
Day 2
Day 4
Day 5
Day 6
Day 7
Day 8
Day 3
3
4
-8
1
9
-2
3
-1
Right Max Sum (Day 5 Day 8) 10
Left Max Sum (Day 1 Day 4) 7
Left Max Subsequence Day Day 2
Right Max Subsequence Day 5 Day 7
Left Max Sum gt Right Max Sum? No
Addition Counter 18
172
Which side has the Largest Sum?
Day 1
Day 2
Day 4
Day 5
Day 6
Day 7
Day 8
Day 3
3
4
-8
1
9
-2
3
-1
Right Max Sum (Day 5 Day 8) 10
Left Max Sum (Day 1 Day 4) 7
Left Max Subsequence Day Day 2
Right Max Subsequence Day 5 Day 7
Left Max Sum gt Right Max Sum? No
Max Side Subsequence Day 5 Day 7
Addition Counter 18
173
Find the Middle Max Subsequence
Find the starting point
Max Side Subsequence Day 5 Day 7
Left Max Sum 7
Right Max Sum 10
Day 1
Day 2
Day 4
Day 5
Day 6
Day 7
Day 8
Day 3
3
4
-8
1
9
-2
3
-1
Sum 1
Left Max Border Sum 0
Mid Start Day 4
Left Max Border Sum is now 1
Addition Counter 18
174
Find the Middle Max Subsequence
Find the starting point
Max Side Subsequence Day 5 Day 7
Left Max Sum 7
Right Max Sum 10
Day 1
Day 2
Day 4
Day 5
Day 6
Day 7
Day 8
Day 3
3
4
-8
1
9
-2
3
-1
Sum 1 8 -7
Left Max Border Sum 1
Mid Start Day 4
No changes made to Left Max Border Sum
Addition Counter 19
175
Find the Middle Max Subsequence
Find the starting point
Max Side Subsequence Day 5 Day 7
Left Max Sum 7
Right Max Sum 10
Day 1
Day 2
Day 4
Day 5
Day 6
Day 7
Day 8
Day 3
3
4
-8
1
9
-2
3
-1
Sum -7 4 -3
Left Max Border Sum 1
Mid Start Day 4
No changes made to Left Max Border Sum
Addition Counter 20
176
Find the Middle Max Subsequence
Find the starting point
Max Side Subsequence Day 5 Day 7
Left Max Sum 7
Right Max Sum 10
Day 1
Day 2
Day 4
Day 5
Day 6
Day 7
Day 8
Day 3
3
4
-8
1
9
-2
3
-1
Sum -3 3 0
Left Max Border Sum 1
Mid Start Day 4
No changes made to Left Max Border Sum
Addition Counter 21
177
Find the Middle Max Subsequence
Find the ending point
Max Side Subsequence Day 5 Day 7
Left Max Sum 7
Right Max Sum 10
Day 1
Day 2
Day 4
Day 5
Day 6
Day 7
Day 8
Day 3
3
4
-8
1
9
-2
3
-1
Left Max Border Sum 1
Sum 9
Mid Start 4
Right Max Border Sum 0
Mid End Day 5
Right Max Border Sum is now 9
Addition Counter 22
178
Find the Middle Max Subsequence
Find the ending point
Max Side Subsequence Day 5 Day 7
Left Max Sum 7
Right Max Sum 10
Day 1
Day 2
Day 4
Day 5
Day 6
Day 7
Day 8
Day 3
3
4
-8
1
9
-2
3
-1
Left Max Border Sum 1
Sum 9 2 7
Mid Start 4
Right Max Border Sum 9
Mid End Day 5
No changes made to Right Max Border Sum
Addition Counter 23
179
Find the Middle Max Subsequence
Find the ending point
Max Side Subsequence Day 5 Day 7
Left Max Sum 7
Right Max Sum 10
Day 1
Day 2
Day 4
Day 5
Day 6
Day 7
Day 8
Day 3
3
4
-8
1
9
-2
3
-1
Left Max Border Sum 1
Sum 7 3 10
Mid Start 4
Right Max Border Sum 9
Mid End Day 5
Right Max Border Sum is now 10 and Mid End is
Day 7
Addition Counter 24
180
Find the Middle Max Subsequence
Find the ending point
Max Side Subsequence Day 5 Day 7
Left Max Sum 7
Right Max Sum 10
Day 1
Day 2
Day 4
Day 5
Day 6
Day 7
Day 8
Day 3
3
4
-8
1
9
-2
3
-1
Left Max Border Sum 1
Sum 10 1 9
Mid Start 4
Right Max Border Sum 10
Mid End Day 7
No changes made to Right Max Border Sum
Addition Counter 25
181
Finding Middle Max Subsequence
Compute Middle Max Sum
Max Side Subsequence Day 5 Day 7
Left Max Sum 7
Right Max Sum 10
Day 1
Day 2
Day 4
Day 5
Day 6
Day 7
Day 8
Day 3
3
4
-8
1
9
-2
3
-1
Right Max Border Sum 10
Left Max Border Sum 1
Mid Start 4
Mid End Day 7
Mid Max Sum Left Max Border
Write a Comment
User Comments (0)
About PowerShow.com