Ayush Gupta has Published 543 Articles

Maximum product of subsequence of size k in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Sep-2020 14:20:26

360 Views

In this problem, we are given an array arr[] of integers and a number k. Our task is to create a program to find the Maximum product of subsequence of size k in C++.Problem Description − Here, we need to find the subsequence of size k, 1

Maximum product of two non-intersecting paths in a tree in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Sep-2020 14:19:33

82 Views

In this problem, we are given an undirected connected tree T with n nodes. Our task is to create a program to find the Maximum product of two nonintersecting paths in a tree in C++.Problem Description − To find the maximum product of two nonintersecting paths in a tree. We ... Read More

Maximum product quadruple (sub-sequence of size 4) in array in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Sep-2020 14:18:33

260 Views

In this problem, we are given an array arr[]. Our task is to create a program to find the Maximum product quadruple (sub-sequence of size 4) in array in C++.Code description − Here, we need to find a quadruple (sub-sequence of size 4) such that the product of all elements ... Read More

Maximum Product Subarray - Using Two Traversals in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Sep-2020 14:17:28

101 Views

In this problem, we are given an array arr[] of integers. Our task is to create a program to find the Maximum Product Subarray - Using Two Traversals in C++.Problem description − Here in the array, we will find the maximum product subarray using two traversals one from index 0 ... Read More

Maximum Product Subarray | Added negative product case in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Sep-2020 14:16:48

105 Views

In this problem, we are given an array of integers(positive as well as negative). Our task is to create a program to calculate the Maximum Product Subarray in C++.Problem Solution − Here, we have an array that contains positive, negative, and zero numbers. We need to find the product of ... Read More

Maximum profit after buying and selling the stocks in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Sep-2020 14:15:16

594 Views

In this problem, we are given an array stkprice[] that denotes the price of a certain stock on i-th day. Our task is to create a program to calculate Maximum profit after buying and selling the stocks in C++.Problem Description − Here, we need to check when can be bought ... Read More

Maximum rational number (or fraction) from an array in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Sep-2020 14:14:32

167 Views

In this problem, we are given a 2-D array that contains rational numbers (one in each row). Our task is to create a program to calculate the maximum rational number (or fraction) from an array in C++.Problem Description − The 2-D array is of the form [n][2]. Each row has ... Read More

Maximum score after flipping a Binary Matrix atmost K times in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Sep-2020 14:12:56

227 Views

In this problem, we are given a 2-D array arr[] consisting of boolean values (i.e 0’s and 1’s) and an integer K. Our task is to create a program to find the Maximum score after flipping a Binary Matrix atmost K times in C++.Problem Description − Here, for the 2-D ... Read More

Maximum set bit sum in array without considering adjacent elements in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Sep-2020 14:11:22

121 Views

In this problem, we are given an array arr[] of integers. Our task is to create a program to calculate the Maximum set bit sum in array without considering adjacent elements in C++.Problem description − Here, we have an array arr[]. We have to find the number of set bits ... Read More

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

Ayush Gupta

Ayush Gupta

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

117 Views

In this tutorial, we will be discussing a program to find maximum sum subsequence with at-least k distant elements.For this we will be provided with an array containing integers and a value K. Our task is to find the subsequence having maximum sum such that all the elements are at ... Read More

Advertisements