Sudhir sharma has Published 1149 Articles

Maximum sum such that no two elements are adjacent Alternate Method in C++ program

sudhir sharma

sudhir sharma

Updated on 09-Dec-2020 13:45:22

409 Views

In this problem, we are given an array arr[] of size n consisting of positive values. Our task is to create a program to find the maximum subsequence sum in such a way that no two consecutive elements of the array.Problem Description − We need to find the sum of ... Read More

Maximum sum subsequence with at-least k distant elements in C++ program

sudhir sharma

sudhir sharma

Updated on 09-Dec-2020 13:43:39

302 Views

In this problem, we are given an array arr[] of size n and a number k. Our task is to create a program to find the maximum sum subsequence with atleast k distant elements.Problem Description − We need to find the sum of subarrays such that the elements of the ... Read More

Maximum sum subarray such that start and end values are same in C++ Program

sudhir sharma

sudhir sharma

Updated on 09-Dec-2020 13:41:11

653 Views

In this problem, we are given an array arr[] of size n consisting of positive values. Our task is to create a program to find the maximum sum subarray such that start and end values are the same.Problem Description − Here, we need to find a subarray such that the ... Read More

Maximum sum possible for a sub-sequence such that no two elements appear at a distance < K in the array in C++ program

sudhir sharma

sudhir sharma

Updated on 09-Dec-2020 13:38:21

304 Views

In this problem, we are given an array arr[] of size n and an integer k. Our task is to create a program to find the maximum sum possible for a subsequence such that no two elements appear at a distance < K in the array.Problem Description − We need ... Read More

Maximum sum path in a matrix from top to bottom and back in C++ Program

sudhir sharma

sudhir sharma

Updated on 09-Dec-2020 13:36:20

293 Views

In this problem, we are given a matrix mat[][] of size nXm. Our task is to create a program to find the maximum sum path in a matrix from top to bottom and back.Problem Description − We need to find the maximum path sum from topleft to bottom−right and then ... Read More

Maximum Sum of Products of Two Array in C++ Program

sudhir sharma

sudhir sharma

Updated on 09-Dec-2020 13:32:47

246 Views

In this problem, we are given two arrays arr1[] and arr2[] of size n. Our task is to create a program to find the maximum Sum of Products of Two Array.Problem Description − We need to find the maximum sum of products of two arrays. We need to find the ... Read More

Maximum sum of smallest and second smallest in an array in C++ Program

sudhir sharma

sudhir sharma

Updated on 09-Dec-2020 13:30:46

511 Views

In this problem, we are given an array arr[]. Our task is to create a program to find the maximum sum of smallest and second smallest in an array.Problem Description − We need to find the sum of the smallest and second smallest elements of a sum subarray of the ... Read More

Maximum sum of pairwise product in an array with negative allowed in C++ program

sudhir sharma

sudhir sharma

Updated on 09-Dec-2020 13:29:22

456 Views

In this problem, we are given an array arr[] that contains n integers values (negative values allowed). Our task is to create a program to find the maximum sum of pairwise products in an array with negative allowed.Problem Description − We need to create pairs using the elements of the ... Read More

Maximum sum of pairs with specific difference C++ program

sudhir sharma

sudhir sharma

Updated on 09-Dec-2020 13:25:11

226 Views

In this problem, we are given an array arr[] of n integers and a number d. Our task is to create a program to find the maximum sum of pairs with specific difference in c++.Problem Description − We will find pairs in such a way that the difference of elements ... Read More

Maximum sum of nodes in Binary tree such that no two are adjacent using Dynamic Programming in C++ program

sudhir sharma

sudhir sharma

Updated on 09-Dec-2020 13:23:31

470 Views

In this problem, we are given a Binary Tree with each node having a value. Our task is to create a program to find the Maximum sum of nodes in Binary tree such that no two are adjacent using Dynamic Programming.Problem Description − We will be choosing the subsets of ... Read More

Advertisements