Ayush Gupta has Published 530 Articles

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

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 13:16:30

186 Views

In this tutorial, we will be discussing a program to find maximum sum of pairwise product in an array with negative allowed.For this we will be provided with an array containing integers. Our task is to find the maximum sum while performing pairwise multiplications.Example Live Demo#include #define Mod 1000000007 using ... Read More

Maximum sum of pairs with specific difference in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 13:13:07

171 Views

In this tutorial, we will be discussing a program to find maximum sum of pairs with specific difference.For this we will be provided with an array containing integers and a value K. Our task is to pair elements having difference less than K and finally find the maximum sum of ... Read More

Maximum sum of nodes in Binary tree such that no two are adjacent in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 13:10:07

215 Views

In this tutorial, we will be discussing a program to find maximum sum of nodes in Binary tree such that no two are adjacent.For this we will be provided with a binary tree. Our task is to find the subset having maximum sum such that no two nodes in subset ... Read More

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

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 13:08:04

119 Views

In this tutorial, we will be discussing a program to find maximum sum of nodes in Binary tree such that no two are adjacent using Dynamic Programming.For this we will be provided with a binary tree. Our task is to find the subset having maximum sum such that no two ... Read More

Maximum sum of increasing order elements from n arrays in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 13:05:50

165 Views

In this tutorial, we will be discussing a program to find maximum sum of increasing order elements from n arrays.For this we will be provided with N arrays of M size. Our task is to find the maximum sum by selecting one element from each array such that element from ... Read More

Maximum product of indexes of next greater on left and right in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 13:03:39

159 Views

In this tutorial, we will be discussing a program to find maximum product of indexes of next greater on left and right.For this we will be provided with an array of integers. Our task is to find the element with maximum Left-Right product (L(i)*R(i) where L(i) is closest index on ... Read More

Maximum product of an increasing subsequence in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 13:01:04

102 Views

In this tutorial, we will be discussing a program to find maximum product of an increasing subsequence.For this we will be provided with an array of integers. Our task is to find the maximum product of any subsequence of the array with any number of elements.Example Live Demo#include #define ll ... Read More

Maximum product of an increasing subsequence of size 3 in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 12:59:02

136 Views

In this tutorial, we will be discussing a program to find maximum product of an increasing subsequence of size 3.For this we will be provided with an array of positive integers. Our task is to find a subsequence of three elements with the maximum product.Example#include using namespace std; //returning maximum ... Read More

Maximum product of a triplet (subsequence of size 3) in array in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 12:57:09

135 Views

In this tutorial, we will be discussing a program to find maximum product of a triplet (subsequence of size 3) in array.For this we will be provided with an array of integers. Our task is to find the triplet of elements in that array with the maximum productExample Live Demo#include ... Read More

Maximum product of 4 adjacent elements in matrix in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 12:54:21

270 Views

In this tutorial, we will be discussing a program to find maximum product of 4 adjacent elements in matrix.For this we will be provided with a square matrix. Our task is to find the maximum product of four adjacent elements which can be top, down, right, left, or diagonal.Example Live Demo#include ... Read More

Advertisements