SlideShare a Scribd company logo
Presented By:
1. Al-Amin Islam Hridoy
ID: 2016-1-60-023
2. Md. Golam Rasul
ID: 2016-1-60-080
3. Nishat Jahan Nishi
ID: 2016-1-60-015
Overview
 Introduction
• What is Maximum Sum Interval?
 Approaches
• Brute Force Algorithm
• Divide and Conquer Algorithm
 Complexity Analysis
 Applications
 Conclusion
Introduction
 A part of an array is an interval which can be one element or two
elements or all of the elements.
{3, -2, 5, -1}
{3, -2, 5} , {-2, 5, -1}
{3, -2} , {-2, 5} , {5, -1}
{3} , {-2} , {5} , {-1}
3 -2 5 -1
3 + (-2) + 5 = 6
Maximum Sum
Interval
History
Ulf Grenander (23 July 1923 – 12 May 2016) was a Swedish statistician and professor
of applied mathematics at Brown University. He first posed this problem in 1977.
Grenander was looking to find the maximum sum of an m * n rectangular region of real
numbers. He designed an algorithm that ran in O(n6) time. His algorithm was too slow
and the problem was too complex to be solved, so he simplified it to one dimension. This
made the problem easier to comprehend and as a result, he was able to solve the original
problem with a faster running time of O(n3).
Approaches
1. Brute Force Algorithm
A[] =
Sum =
3 -2 5 -1
INT_MIN
3 = 3
3 > INT_MIN
Approaches
1. Brute Force Algorithm
A[] =
Sum =
3 -2 5 -1
3
-2
3
5
= 3
= -2
= 5
5 > 3
Approaches
1. Brute Force Algorithm
A[] =
Sum =
3 -2 5 -1
5
-2
3
5
-1
= 3
= -2
= 5
= -1
Approaches
1. Brute Force Algorithm
A[] =
Sum =
3 -2 5 -1
5
-23
-2 5
= 1
= 3
5 -1 = 4
Approaches
1. Brute Force Algorithm
A[] =
Sum =
3 -2 5 -1
5
-23 5 = 6
6 > 5
Approaches
1. Brute Force Algorithm
A[] =
Sum =
3 -2 5 -1
6
-23
-2
5 = 6
= 25 -1
Approaches
1. Brute Force Algorithm
A[] =
Sum =
3 -2 5 -1
6
-23 5 = 5-1
Approaches
1. Brute Force Algorithm
A[] =
Sum =
3 -2 5 -1
6 Maximum Sum
Interval
Approaches
1. Brute Force Algorithm
max = INT_MIN;
For i = 0 to N-1
For j = i to N-1 {
sum = 0;
For x = i to j
sum = sum + A[x];
If sum > max then
max = sum;
}
Return (max);
𝑶(𝒏 𝟑
)
Approaches
2. Divide and Conquer Algorithm
Divide and Conquer is an algorithm design paradigm based on multi-branched recursion. A divide and
conquer algorithm works by recursively breaking down a problem into two or more sub-problems of
the same or related type, until these become simple enough to be solved directly. The solutions to
the sub-problems are then combined to give a solution to the original problem.
Approaches
2. Divide and Conquer Algorithm
3 -2 5 -1
3 -2 5 -1
3 -2 5 -1
Approaches
2. Divide and Conquer Algorithm
3 -2 5 -1
3 -2 5 -1
3 -2 5 -1
3 -2 5 -1
2. Divide and Conquer Algorithm
Max Left sum =
Max Right sum =
Max Cross sum =
Approaches
3 -2 5 -1
3 -2 5 -1
3 -2 5 -1
3 -2 5 -11
3
-2
1
3
2. Divide and Conquer Algorithm
Max Left sum =
Max Right sum =
Max Cross sum =
Approaches
3 -2 5 -1
3 -2 5 -1
3 -2 5 -1
3 -2 5 -11
3
4
5
-1
4
5
2. Divide and Conquer Algorithm
Max Left sum =
Max Right sum =
Max Cross sum =
Approaches
3 -2 5 -1
3 -2 5 -1
3 -2 5 -1
3 -2 5 -11
3
4
56
3
5
6
6
Max Cross sum Calculation:
Left sum = max {(-2) , (-2+3)} = 1
Right sum = max {(5) , (5-1)} = 5
Cross sum = Left sum + Right sum = 6
2. Divide and Conquer Algorithm
Approaches
3 -2 5 -1
3 -2 5 -1
3 -2 5 -1
3 -2 5 -11
3
4
56
6
Maximum Sum
Interval 6
2. Divide and Conquer Algorithm
MSI (A , i , j)
If i == j
Return ( A[i] );
Else
Find MSI ( A , i ,
𝑖+𝑗
2
);
Find MSI ( A ,
𝑖+𝑗
2
+1 , j );
Find MSI that contains both A [
𝑖+𝑗
2
] and A[
𝑖+𝑗
2
+1];
Return maximum of the three sequences found;
Approaches
𝑶(𝒏𝒍𝒐𝒈𝒏)
Complexity Analysis
𝑂(𝑛3
) 𝑂(𝑛2
)
𝑂(𝑛𝑙𝑜𝑔𝑛)
𝑂(𝑛)
Complexity Analysis of the Approaches
Kadane’s
Algorithm
Applications
Genomic sequence analysis
Protein domain sequence analysis
Applications
Genomic sequence analysis
Computer Vision
Applications
Genomic sequence analysis
Computer Vision
Data Mining
Applications
Genomic sequence analysis
Computer Vision
Data Mining
Conclusion
‘Maximum Sum Interval’ is a very important problem to be solved
to implement very important tasks in our life. The innovative of
this project is to solving this problem using ‘Divide and Conquer’
algorithm. Although ‘Dynamic Programming’ can be a faster
approach to solve it, ‘Divide and Conquer’ is not that a slow
approach. In compare to the ‘Brute Force’ approach we can say,
this is really a very fast approach to solve this problem.
In summary, we learned about ‘Maximum Sum Interval’ problem
and learned how to solve it in different approaches with different
complexities. We also achieved a much better understanding
‘Divide and Conquer’ algorithm than before.
References
• www.wikipedia.org
• www.geeksforgeeks.org
• www.stackoverflow.com
• www.shutterstock.com
• Google Images (public domain)
THE END

More Related Content

PPTX
INEQUALITIES IN A TRIANGLE SIDE ANGLE RELATIONSHIP.pptx
PDF
Introduction to Logarithm
PPT
Maths ppt on algebraic expressions and identites
PPTX
Set Theory
PPT
Solving Equations (Algebra 2)
PPTX
Straight lines
PPTX
Chapter 2 Squares, Square roots, Cubes and Cube roots
PPT
Expressions and equations
INEQUALITIES IN A TRIANGLE SIDE ANGLE RELATIONSHIP.pptx
Introduction to Logarithm
Maths ppt on algebraic expressions and identites
Set Theory
Solving Equations (Algebra 2)
Straight lines
Chapter 2 Squares, Square roots, Cubes and Cube roots
Expressions and equations

What's hot (20)

PPT
1.1 writing expressions and equations lesson
PPTX
Application of Linear Algebra in Real Life
PPTX
Basics of Vedic Mathematics - Multiplication (1 of 2)
PPT
THE BINOMIAL THEOREM
PPT
Area & volume
PPTX
exponents and power
PPTX
number theory.ppt
PPTX
11.3 Combinations
PPTX
Binomial Theorem
PPT
permutation and combination
PPTX
How to Prove and Apply De Morgan's Laws
PDF
Basic Number Theory Questions for Practice by Examsegg
PPTX
cheyene ppt.pptx
PPTX
Reducible equation to quadratic form
PDF
El Calculo y la Geometría Analítica GA1 ccesa007
PPTX
Solving multi step equations
PPTX
Exponents and Powers
PDF
Geometry Section 4-5
PPTX
Permutation
PDF
1.1 writing expressions and equations lesson
Application of Linear Algebra in Real Life
Basics of Vedic Mathematics - Multiplication (1 of 2)
THE BINOMIAL THEOREM
Area & volume
exponents and power
number theory.ppt
11.3 Combinations
Binomial Theorem
permutation and combination
How to Prove and Apply De Morgan's Laws
Basic Number Theory Questions for Practice by Examsegg
cheyene ppt.pptx
Reducible equation to quadratic form
El Calculo y la Geometría Analítica GA1 ccesa007
Solving multi step equations
Exponents and Powers
Geometry Section 4-5
Permutation
Ad

Similar to Maximum Sum Interval (20)

DOCX
270-102-divide-and-conquer_handout.pdfCS 270Algorithm.docx
PDF
Daa chapter 2
PPTX
Divide and conquer
PDF
Divide and Conquer Case Study
PDF
3 chapter2 algorithm_analysispart2
PPT
Divide and conquer algorithm
PPTX
Design and Analysis of Algorithms Lecture Notes
PPTX
Algorithm in computer science
PDF
Cs6402 design and analysis of algorithms may june 2016 answer key
PDF
Data Analysis and Algorithms Lecture 1: Introduction
PPTX
Divide and Conquer / Greedy Techniques
PPTX
Divide and Conquer - Part 1
PPTX
TRAVELING SALESMAN PROBLEM, Divide and Conquer
DOC
algorithm Unit 2
DOC
Unit 2 in daa
PPTX
Chapter 5.pptx
PDF
Algo Strategies and explaination ppt.pdf
PPTX
Algorithm Using Divide And Conquer
PPTX
Daa unit 2
270-102-divide-and-conquer_handout.pdfCS 270Algorithm.docx
Daa chapter 2
Divide and conquer
Divide and Conquer Case Study
3 chapter2 algorithm_analysispart2
Divide and conquer algorithm
Design and Analysis of Algorithms Lecture Notes
Algorithm in computer science
Cs6402 design and analysis of algorithms may june 2016 answer key
Data Analysis and Algorithms Lecture 1: Introduction
Divide and Conquer / Greedy Techniques
Divide and Conquer - Part 1
TRAVELING SALESMAN PROBLEM, Divide and Conquer
algorithm Unit 2
Unit 2 in daa
Chapter 5.pptx
Algo Strategies and explaination ppt.pdf
Algorithm Using Divide And Conquer
Daa unit 2
Ad

Recently uploaded (20)

PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPT
Project quality management in manufacturing
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
DOCX
573137875-Attendance-Management-System-original
PPTX
Geodesy 1.pptx...............................................
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
PPT on Performance Review to get promotions
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Artificial Intelligence
PPTX
web development for engineering and engineering
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Construction Project Organization Group 2.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
Lecture Notes Electrical Wiring System Components
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Project quality management in manufacturing
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
CYBER-CRIMES AND SECURITY A guide to understanding
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
573137875-Attendance-Management-System-original
Geodesy 1.pptx...............................................
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPT on Performance Review to get promotions
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Artificial Intelligence
web development for engineering and engineering
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Construction Project Organization Group 2.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Lecture Notes Electrical Wiring System Components

Maximum Sum Interval

  • 1. Presented By: 1. Al-Amin Islam Hridoy ID: 2016-1-60-023 2. Md. Golam Rasul ID: 2016-1-60-080 3. Nishat Jahan Nishi ID: 2016-1-60-015
  • 2. Overview  Introduction • What is Maximum Sum Interval?  Approaches • Brute Force Algorithm • Divide and Conquer Algorithm  Complexity Analysis  Applications  Conclusion
  • 3. Introduction  A part of an array is an interval which can be one element or two elements or all of the elements. {3, -2, 5, -1} {3, -2, 5} , {-2, 5, -1} {3, -2} , {-2, 5} , {5, -1} {3} , {-2} , {5} , {-1} 3 -2 5 -1 3 + (-2) + 5 = 6 Maximum Sum Interval
  • 4. History Ulf Grenander (23 July 1923 – 12 May 2016) was a Swedish statistician and professor of applied mathematics at Brown University. He first posed this problem in 1977. Grenander was looking to find the maximum sum of an m * n rectangular region of real numbers. He designed an algorithm that ran in O(n6) time. His algorithm was too slow and the problem was too complex to be solved, so he simplified it to one dimension. This made the problem easier to comprehend and as a result, he was able to solve the original problem with a faster running time of O(n3).
  • 5. Approaches 1. Brute Force Algorithm A[] = Sum = 3 -2 5 -1 INT_MIN 3 = 3 3 > INT_MIN
  • 6. Approaches 1. Brute Force Algorithm A[] = Sum = 3 -2 5 -1 3 -2 3 5 = 3 = -2 = 5 5 > 3
  • 7. Approaches 1. Brute Force Algorithm A[] = Sum = 3 -2 5 -1 5 -2 3 5 -1 = 3 = -2 = 5 = -1
  • 8. Approaches 1. Brute Force Algorithm A[] = Sum = 3 -2 5 -1 5 -23 -2 5 = 1 = 3 5 -1 = 4
  • 9. Approaches 1. Brute Force Algorithm A[] = Sum = 3 -2 5 -1 5 -23 5 = 6 6 > 5
  • 10. Approaches 1. Brute Force Algorithm A[] = Sum = 3 -2 5 -1 6 -23 -2 5 = 6 = 25 -1
  • 11. Approaches 1. Brute Force Algorithm A[] = Sum = 3 -2 5 -1 6 -23 5 = 5-1
  • 12. Approaches 1. Brute Force Algorithm A[] = Sum = 3 -2 5 -1 6 Maximum Sum Interval
  • 13. Approaches 1. Brute Force Algorithm max = INT_MIN; For i = 0 to N-1 For j = i to N-1 { sum = 0; For x = i to j sum = sum + A[x]; If sum > max then max = sum; } Return (max); 𝑶(𝒏 𝟑 )
  • 14. Approaches 2. Divide and Conquer Algorithm Divide and Conquer is an algorithm design paradigm based on multi-branched recursion. A divide and conquer algorithm works by recursively breaking down a problem into two or more sub-problems of the same or related type, until these become simple enough to be solved directly. The solutions to the sub-problems are then combined to give a solution to the original problem.
  • 15. Approaches 2. Divide and Conquer Algorithm 3 -2 5 -1 3 -2 5 -1 3 -2 5 -1
  • 16. Approaches 2. Divide and Conquer Algorithm 3 -2 5 -1 3 -2 5 -1 3 -2 5 -1 3 -2 5 -1
  • 17. 2. Divide and Conquer Algorithm Max Left sum = Max Right sum = Max Cross sum = Approaches 3 -2 5 -1 3 -2 5 -1 3 -2 5 -1 3 -2 5 -11 3 -2 1 3
  • 18. 2. Divide and Conquer Algorithm Max Left sum = Max Right sum = Max Cross sum = Approaches 3 -2 5 -1 3 -2 5 -1 3 -2 5 -1 3 -2 5 -11 3 4 5 -1 4 5
  • 19. 2. Divide and Conquer Algorithm Max Left sum = Max Right sum = Max Cross sum = Approaches 3 -2 5 -1 3 -2 5 -1 3 -2 5 -1 3 -2 5 -11 3 4 56 3 5 6 6 Max Cross sum Calculation: Left sum = max {(-2) , (-2+3)} = 1 Right sum = max {(5) , (5-1)} = 5 Cross sum = Left sum + Right sum = 6
  • 20. 2. Divide and Conquer Algorithm Approaches 3 -2 5 -1 3 -2 5 -1 3 -2 5 -1 3 -2 5 -11 3 4 56 6 Maximum Sum Interval 6
  • 21. 2. Divide and Conquer Algorithm MSI (A , i , j) If i == j Return ( A[i] ); Else Find MSI ( A , i , 𝑖+𝑗 2 ); Find MSI ( A , 𝑖+𝑗 2 +1 , j ); Find MSI that contains both A [ 𝑖+𝑗 2 ] and A[ 𝑖+𝑗 2 +1]; Return maximum of the three sequences found; Approaches 𝑶(𝒏𝒍𝒐𝒈𝒏)
  • 27. Conclusion ‘Maximum Sum Interval’ is a very important problem to be solved to implement very important tasks in our life. The innovative of this project is to solving this problem using ‘Divide and Conquer’ algorithm. Although ‘Dynamic Programming’ can be a faster approach to solve it, ‘Divide and Conquer’ is not that a slow approach. In compare to the ‘Brute Force’ approach we can say, this is really a very fast approach to solve this problem. In summary, we learned about ‘Maximum Sum Interval’ problem and learned how to solve it in different approaches with different complexities. We also achieved a much better understanding ‘Divide and Conquer’ algorithm than before.
  • 28. References • www.wikipedia.org • www.geeksforgeeks.org • www.stackoverflow.com • www.shutterstock.com • Google Images (public domain)