Sudhir sharma has Published 1149 Articles

Find the largest BST subtree in a given Binary Tree - Set 1 in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 10:52:08

289 Views

In this problem, we are given a binary tree BT. Our task is to find the largest BST subtree in a given Binary Tree.Binary Tree is a special data structure used for data storage purposes. A binary tree has a special condition that each node can have a maximum of ... Read More

Find the largest after deleting the given elements in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 08:51:23

201 Views

In this problem, we are given an array aar[] of size n and another array del[] of size m. Our task is to find the largest after deleting the given elements. If the deletion of an element with multiple instances is required, delete the first instance of the element.Let's take ... Read More

Find the Kth node in the DFS traversal of a given subtree in a Tree in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 08:45:24

174 Views

In this problem, we are given a tree of size N, a node of the tree V and k. Our task is find the Kth node in the DFS traversal of a given subtree in a Tree.We need to find the kth node in the DFS traversal of the tree ... Read More

Find the kth element in the series generated by the given N ranges in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 08:27:50

248 Views

In this problem, we are given a N range of integer values between intervals L - R as an matrix range[N][2] and an integer value k. Our task is to find the kth element in the series generated by the given N ranges.Let's take an example to understand the problem, ... Read More

Find the k-th smallest divisor of a natural number N in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 08:20:50

546 Views

In this problem, we are given two integer values N and k. Our task is to find the k-th smallest divisor of a natural number N.Let's take an example to understand the problem, Input : N = 15, k = 3 Output : 5Explanation −Factors of 15 are 1, 3, ... Read More

Find the k smallest numbers after deleting given elements in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 08:07:45

210 Views

In this problem, we are given an array arr[] of size n, array del[] of size m, and an integer k. Our task is to find the k smallest numbers after deleting the given elements.We need to print the first k smallest elements from the array arr[] found after deleting ... Read More

Find the k largest numbers after deleting the given elements in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 07:46:25

296 Views

In this problem, we are given an array arr[] of size n, array del[] of size m, and an integer k. Our task is to find the k largest numbers after deleting the given elements.We need to print the first k largest elements from the array arr[] found after deleting ... Read More

Find the Initial Array from given array after range sum queries in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 07:37:49

249 Views

In this problem, we are given an array res[] of size N. Our task is to find the Initial Array from given array after range sum queries.We need to find the starting array which will return the array rel[] on performing [s, e, val] query on it.Each [s, e, val] ... Read More

Find the index of first 1 in an infinite sorted array of 0s and 1s in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 07:32:17

608 Views

In this problem, we are given an infinite array bin[] consisting of boolean values (only 0's and 1's) in sorted order. Our task is to find the index of first 1 in an infinite sorted array of 0's and 1's.Here, we have an infinite array which guarantees that there exists ... Read More

Find the index of the left pointer after possible moves in the array in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 07:32:10

173 Views

In this problem, we are given an array arr[] of size N. Our task is to find the index of the left pointer after possible moves in the array.We have two pointers for the array, one left pointer and another right pointer.Left pointer starts at index 0 and the value ... Read More

Advertisements