Sudhir sharma has Published 1031 Answers

C Program for Binary Search (Recursive and Iterative)?

sudhir sharma

sudhir sharma

Updated on 19-Sep-2022 07:34:17

The binary search algorithm is an algorithm that is based on compare and split mechanism. The binary Search algorithm is also known as half-interval search, logarithmic search, or binary chop. The binary search algorithm, search the position of the target value in a sorted array. It compares the target value ... Read More

Find the smallest after deleting given elements using C++

sudhir sharma

sudhir sharma

Updated on 14-Feb-2022 09:21:12

In this problem, we are given two arrays arr[] and del[]. Our task is to find the smallest after deleting given elements.We will be deleting values from the array arr[] that are present in del[]. And then print the smallest value after deletion.Let’s take an example to understand the problem, ... Read More

Find the slope of the given number using C++

sudhir sharma

sudhir sharma

Updated on 14-Feb-2022 09:16:48

In this problem, we are given a number N. Our task is to find the slope of the given number.Slope of a number is the total number of maxima and minima digits in the number.Maxima digit is the digit whose both neighbours (previous and next) are smaller.Maxima digit is the ... Read More

Minimum Fibonacci terms with sum equal to K in C++

sudhir sharma

sudhir sharma

Updated on 14-Feb-2022 09:13:05

In this problem, we are given a number K. Our task is to find the Minimum Fibonacci terms with sum equal to K.Fibonacci Series generates subsequent numbers by adding two previous numbers. The Fibonacci series starts from two numbers − F0 & F1. The initial values of F0 & F1 ... Read More

Find the number of elements greater than k in a sorted array using C++

sudhir sharma

sudhir sharma

Updated on 14-Feb-2022 08:04:13

In this problem, we are given an array arr[] consisting of N sorted integer values and an integer k. Our task is to Find the number of elements greater than k in a sorted array. Let’s take an example to understand the problem, Input arr[] = {1, 2, 5, 7, 8, ... Read More

Maximum occurred integer in n ranges using C++

sudhir sharma

sudhir sharma

Updated on 14-Feb-2022 07:59:13

In this problem, we are given N ranges. Our task is to maximum occurred integer in n ranges.For the starting and ending value of all ranges. We need to find the value which occurs the most.Let’s take an example to understand the problem, Input S1 = 1, E1 = 3 ... Read More

Find the Nth term of the series 14, 28, 20, 40,….. using C++

sudhir sharma

sudhir sharma

Updated on 14-Feb-2022 07:52:06

In this problem, we are given an integer value N.Our task is to find the nth term of the series −14, 28, 20, 40, 32, 64, 56, 112….Let’s take an example to understand the problem, InputN = 6Output64Solution ApproachTo find the Nth term of the series we need to find ... Read More

C++ program to find Nth Non Fibonacci Number

sudhir sharma

sudhir sharma

Updated on 14-Feb-2022 07:43:34

In this problem, we are given an integer value N. Our task is to use a C + + program to find the Nth Non Fibonacci Number.Fibonacci Series generates subsequent number by adding two previous numbers. The Fibonacci series starts from two numbers − F0 & F1. The initial values ... Read More

Find the row with maximum number of 1s using C++

sudhir sharma

sudhir sharma

Updated on 14-Feb-2022 07:39:08

In this problem, we are given a binary matrix where elements of each row are sorted. Our task is to find the row with maximum number of 1s.Let’s take an example to understand the problem, Inputmat[][] = {{ 0 1 1 1}    {1 1 1 1}    {0 0 ... Read More

Find the repeating and the missing number using two equations in C++

sudhir sharma

sudhir sharma

Updated on 11-Feb-2022 13:06:01

In this problem, we are given an array arr[] of size N. It consists of integer values ranging from 1 to N. And one element x from the range is missing whereas one element y in the array occurs double. Our task is to find the repeating and the missing ... Read More

1 2 3 4 5 6 7 ... 104 Next
Advertisements