Sudhir sharma has Published 1206 Articles

Print all numbers whose set of prime factors is a subset of the set of the prime factors of X in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2020 09:55:23

161 Views

In this problem, we are given a set of N numbers and a number X. And we have to print all numbers from the array whose set of prime factors is a subset of the set of prime factors of X.Let’s take an example to understand the problemInput: X= 30 ... Read More

Print all odd nodes of Binary Search Tree in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2020 09:51:54

195 Views

In this problem, we are given a binary search tree and we have to print all the nodes that have odd values.The binary search tree is a special type of tree that possess the following properties −The left subtree always has values smaller than the root node.The right subtree always ... Read More

Print all odd numbers and their sum from 1 to n in PL/SQL

sudhir sharma

sudhir sharma

Updated on 22-Jan-2020 09:46:19

2K+ Views

In this problem, we are given a number n and we have to print all odd numbers from 1 to n and also print the sum of numbers from 1 to n in PL/SQL.PL/SQL is a procedural language extension to SQL. The code is a sequence of instructions that are ... Read More

Print all pairs in an unsorted array with equal sum in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2020 09:42:05

207 Views

In this problem, we have an unsorted array and we have to print all pairs within this array that have an equal sum.Let’s take an example to understand the problem −Input: array = [12, 13, 20, 5] Output: [12, 13] and [20, 5] have sum 25.To solve this problem, we ... Read More

Print all pairs of anagrams in a given array of strings in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2020 09:37:31

358 Views

In this problem, we are given an array of strings and we have to print all pairs of anagrams of that given array.Anagrams are strings that are formed by rearranging the character of another string. Like − hello and lolheLet’s take an example to understand the problem −Input: array = ... Read More

Print all possible combinations of r elements in a given array of size n in C++

sudhir sharma

sudhir sharma

Updated on 17-Jan-2020 11:42:28

2K+ Views

In this problem, we are given an array of size n and a positive integer r. Our task is to print all possible combinations of the elements of the array of size r.Let’s take an example to understand the problem −Input: {5, 6, 7, 8} ; r = 3 Output ... Read More

Print all possible expressions that evaluate to a target in C++

sudhir sharma

sudhir sharma

Updated on 17-Jan-2020 11:38:28

212 Views

In this problem, we are given a string of integers from 0 to 9 and a target value. We have to print out ways in which we can generate expression using +, -, and * operation which is evaluated to the value equal to target.Let’s take an example to understand ... Read More

Print all possible paths from top left to bottom right of a mXn matrix in C++

sudhir sharma

sudhir sharma

Updated on 17-Jan-2020 11:36:41

295 Views

In this problem, we are given an mXn 2D matrix and we have to print all possible paths from top left to the bottom right of the matrix. For traversal, we can move only right and down in the matrix.Let’s take an example to understand the topic better −Input: 1 ... Read More

Print all possible strings of length k that can be formed from a set of n characters in C++

sudhir sharma

sudhir sharma

Updated on 17-Jan-2020 11:35:01

2K+ Views

In this problem, we are given a set of characters and a positive integer k and we have to print all possible strings of length k that can be generated using the characters of the set.Let’s take an example to understand the problem better −Input: set = {‘x’, ‘y’, ‘z’} ... Read More

Print all possible strings that can be made by placing spaces in C++

sudhir sharma

sudhir sharma

Updated on 17-Jan-2020 11:31:08

316 Views

In this problem, we are given a string and we have to print all those string that can be made using this string by placing space in between the characters of the string.Let’s take an example to understand the topic better −Input: string = ‘XYZ’ Output: XYZ, XY Z, X ... Read More

Advertisements