Sudhir sharma has Published 1206 Articles

C++ program to find Nth number of the series 1, 6, 15, 28, 45, …..

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 13:10:39

232 Views

In this problem, we are given an integer value N. Our task is to create a program to Find Nth number of the series 1, 6, 15, 28, 45, …In the series, every element is 2 less than the mean of the previous and next element.Let’s take an example to ... Read More

Find nth Hermite number in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 13:09:30

73 Views

In this problem, we are given an integer value N. Our task is to create a program to Find nth Hermite number.Hermite Number is a number is the value of hermite number when there are 0 arguments.Nth hermite Number is HN = (-2) * (N - 1) * H(N-2) The ... Read More

Find Next Sparse Number in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 13:06:17

293 Views

In this problem, we are given an integer value N. our task is to create a program to find the next spares Number.Sparse Number is a special type of number whose binary conversion does not contain any adjacent 1’s.Example: 5(101) , 16(10000)Problem Description − For the given number N, we ... Read More

Find next Smaller of next Greater in an array in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 13:03:33

254 Views

In this problem, we are given an array arr[] consisting of n integer values. Our task is to Find the next Smaller of the next Greater in an array.Problem Description − We will find an element greater than the current element in the array and then we will be finding ... Read More

Find next right node of a given key in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 13:00:02

168 Views

In this problem, we are given a binary Tree BT and a key value. Our task is to Find next right node of a given key.Binary Tree is a special data structure used for data storage purposes.Let’s take an example to understand the problem, Inputkey = 4Output5ExplanationThe element next to ... Read More

Find next palindrome prime in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:37:34

202 Views

In this problem, we are given an element N. We need to find the next palindrome prime.Problem Description − We need to find the smallest prime number which is also a palindrome number, greater than N.Palindrome Number is a number in which the numbers are the same in both directions.Prime ... Read More

Find next greater number with same set of digits in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:34:42

1K+ Views

In this problem, we are given an element N. We need to find the next greater number with the same set of digits. We need to find the smallest number with the same digit which is greater than N.Let’s take an example to understand the problem, InputN = "92534"Output92543Solution ApproachA ... Read More

Find n’th number in a number system with only 3 and 4 in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:33:05

1K+ Views

In this problem, we are given an element N. we need to find the N’th number in a number system with only 3 and 4.The number system consists of elements 3, 4, 33, 34, 43, 44, 333, 334, 343, 344, …Let’s take an example to understand the problem, InputN = ... Read More

Find N’th item in a set formed by sum of two arrays in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:30:53

95 Views

In this problem, we are given two sorted arrays arr1[] and arr2[] of size m and an element N. Our task is to Find Nth item in a set formed by the sum of two arrays.Code description − Here, we will create a set that consists of the sum of element ... Read More

Find n-variables from n sum equations with one missing in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:27:57

47 Views

In this problem, we are given an array sum[] consisting of a sum of (n-1) variables given as, Sum[1] = x2 + x3 + x4 + … xn Sum[2] = x1 + x3 + x4 + … xn . . Sum[i] = x2 + x3 + x4 + … x(i-1) ... Read More

Advertisements