Ayush Gupta has Published 430 Articles

Queries to return the absolute difference between Lth smallest number and the R-th smallest number in C++

Ayush Gupta

Ayush Gupta

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

168 Views

In this tutorial, we will be discussing a program to find queries to return the absolute difference between L-th smallest number and the R-th smallest number.For this we will be provided with an array containing integers and Q queries. Our task is to find the absolute difference between the indices ... Read More

Querying the number of distinct colors in a subtree of a colored tree using BIT in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:51:40

234 Views

In this tutorial, we will be discussing a program to find querying the number of distinct colors in a subtree of a colored tree using BIT.For this we will be provided with rooted tree where each node has a color denoted by given array. Our task is to find all ... Read More

Queries to update a given index and find gcd in range in C++

Ayush Gupta

Ayush Gupta

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

165 Views

In this tutorial, we will be discussing a program to find queries to update a given index and find gcd in range.For this we will be provided with an array containing integers and Q queries. Our task is to find the result of given queries (updating a given value by ... Read More

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

136 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

194 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 two distinct prime numbers with given product in C++

Ayush Gupta

Ayush Gupta

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

196 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

185 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

182 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

239 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

396 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

Advertisements