Sudhir sharma has Published 1206 Articles

Find the largest pair sum in an unsorted array in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 11:32:16

827 Views

In this problem, we are given an arr[] consisting of N unsorted elements. Our task is to find the largest pair sum in an unsorted array.We will find a pair whose sum is the maximum.Let's take an example to understand the problem, Input : arr[] = {7, 3, 9, 12, ... Read More

Find the largest number with n set and m unset bits in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 11:28:26

120 Views

In this problem, we are given two integer values, n and m. Our task is to find the largest number with n set and m unset bits in the binary representation of the number.Let's take an example to understand the problemInput : n = 3, m = 1 Output : ... Read More

Find the Largest number with given number of digits and sum of digits in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 11:21:10

1K+ Views

In this problem, we are given two integer values, N denoting the count of digits of a number and sum denoting the sum of digits of the number. Our task is to find the largest number with given number of digits and sum of digits.Let's take an example to understand ... Read More

Find the largest node in Doubly linked list in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 11:13:04

246 Views

In this problem, we are given a doubly linked list LL. Our task is to find the largest node in Doubly Linked List.Let's take an example to understand the problem, Input : linked-list = 5 -> 2 -> 9 -> 8 -> 1 -> 3 Output : 9Solution ApproachA simple ... Read More

Find the largest multiple of 2, 3 and 5 in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 11:06:27

143 Views

In this problem, we are given an array arr[] of size N consisting of single digits only. Our task is to find the largest multiple of 2, 3 and 5.Let's take an example to understand the problem, Input : arr[] = {1, 0, 5, 2} Output : 510Explanation −The number ... Read More

Find the largest good number in the divisors of given number N in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 10:58:00

177 Views

In this problem, we are given a number N. Our task is to find the largest good number in the divisors of given number N.A good number is a number in which every digit is larger than the sum of digits of its right (all less significant bits than it). ... Read More

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

187 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

122 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

108 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

187 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

Advertisements