Category Archives: Dynamic Programming

Maximum sum Bi-tonic Sub-sequence

Given an array of integers. A subsequence of arr[] is called Bitonic if it is first increasing, then decreasing. Examples: Input : arr[] = {1, 15, 51, 45, 33, 100, 12, 18, 9} Output : 194 Explanation : Bi-tonic Sub-sequence are : {1, 51, 9} or {1, 50, 100, 18, 9} or {1, 15, 51,… Read More »

Minimum and Maximum values of an expression with * and +

Given an expression which contains numbers and two operators ‘+’ and ‘*’, we need to find maximum and minimum value which can be obtained by evaluating this expression by different parenthesization. Examples: Input : expr = “1+2*3+4*5” Output : Minimum Value = 27, Maximum Value = 105 Explanation: Minimum evaluated value = 1 + (2*3)… Read More »