Ayush Gupta has Published 530 Articles

Find triplet such that number of nodes connecting these triplets is maximum in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:41:07

104 Views

In this tutorial, we will be discussing a program to find triplet such that number of nodes connecting these triplets is maximum.For this we will be provided with a tree with N nodes. Our task is to find a triplet of nodes such that the nodes covered in the path ... Read More

Find trace of matrix formed by adding Row-major and Column-major order of same matrix in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:38:48

152 Views

In this tutorial, we will be discussing a program to find trace of matrix formed by adding Row-major and Column-major order of same matrix.For this we will be provided with two arrays one in row-major and other in columnmajor. Our task is to find the trace of the matrix formed ... Read More

Find uncommon characters of the two strings in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:36:14

165 Views

In this tutorial, we will be discussing a program to find uncommon characters of the two strings.For this we will be provided with two strings. Our task is to print out the uncommon characters of both strings in sorted order.Example Live Demo#include using namespace std; const int LIMIT_CHAR = 26; ... Read More

Find two distinct prime numbers with given product in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:34:42

147 Views

In this tutorial, we will be discussing a program to find two distinct prime numbers with given product.For this we will be provided with an integer value. Our task is to find the two prime integer values such that their product is equal to the given value.Example Live Demo#include using ... Read More

Maximum Sum Increasing Subsequence | DP-14 in C++

Ayush Gupta

Ayush Gupta

Updated on 22-Jul-2020 08:20:57

152 Views

In this tutorial, we will be discussing a program to find maximum Sum Increasing Subsequence.For this we will be provided with an array containing N integers. Our task is to pick up elements from the array adding to the maximum sum such that the elements are in sorted orderExample Live Demo#include ... Read More

Maximum sum alternating subsequence in C++

Ayush Gupta

Ayush Gupta

Updated on 10-Jul-2020 14:20:34

135 Views

In this tutorial, we will be discussing a program to find maximum sum alternating subsequence.For this we will be provided with an array of integers. Our task is to find the maximum sum of an alternating subsequence i.e sequence which is first decreasing, then increasing, then decreasing and so on.Example Live ... Read More

Maximum sub-tree sum in a Binary Tree such that the sub-tree is also a BST in C++

Ayush Gupta

Ayush Gupta

Updated on 10-Jul-2020 14:18:26

194 Views

In this tutorial, we will be discussing a program to find maximum sub-tree sum in a Binary Tree such that the sub-tree is also a BST.For this we will be provided with a binary tree. Our task is to print the sum of a sub-tree which is also a binary ... Read More

Maximum subsequence sum such that no three are consecutive

Ayush Gupta

Ayush Gupta

Updated on 10-Jul-2020 14:15:14

342 Views

In this tutorial, we will be discussing a program to find maximum subsequence sum such that no three are consecutive.For this we will be provided with a series of positive integers. Our task is to find the maximum sum without taking in their consecutive positive integers in the sum value.Example Live ... Read More

Maximum sub-matrix area having count of 1’s one more than count of 0’s in C++

Ayush Gupta

Ayush Gupta

Updated on 10-Jul-2020 14:13:32

98 Views

In this tutorial, we will be discussing a program to find maximum sub-matrix area having count of 1’s one more than count of 0’s.For this we will be provided with a matrix containing 0’s and 1’s. Our task is to get the sub-matrix of maximum area containing more 1’s than ... Read More

Maximum subarray sum in an array created after repeated concatenation in C++

Ayush Gupta

Ayush Gupta

Updated on 10-Jul-2020 14:08:47

122 Views

In this tutorial, we will be discussing a program to find maximum subarray sum in an array created after repeated concatenation.For this we will be provided with an array and an integer K. Our task is to find the subarray with the maximum elements when the given array is repeated ... Read More

Advertisements