Sudhir sharma has Published 1149 Articles

Find the index of first 1 in a sorted array of 0's and 1's in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 07:20:11

561 Views

In this problem, we are given an 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 a sorted array of 0's and 1's.Let's take an example to understand the problem, Input : bin[] = {0, ... Read More

Find the hypotenuse of a right angled triangle with given two sides in C++

sudhir sharma

sudhir sharma

Updated on 27-Jan-2022 11:07:53

2K+ Views

In this problem, we are given two integer values H and B defining height and base of a right angled triangle. Our task is to find the hypotenuse of a right angled triangle with given two sides.Right Angled Triangle is a special triangle whose two angles are at right angles.Let's ... Read More

Find the good permutation of first N natural numbers C++

sudhir sharma

sudhir sharma

Updated on 27-Jan-2022 11:01:35

276 Views

In this problem, we are an integer value N. Our task is to find the good permutation of first N natural numbers.permutation is an arrangement of all or part of a set of objects, with regard to the order of the arrangement.Good Permutation is a permutation in which $1\leqslant{i}\leqslant{N}$ and ... Read More

Find the first repeating element in an array of integers C++

sudhir sharma

sudhir sharma

Updated on 27-Jan-2022 10:59:12

558 Views

In this problem, we are an array arr of n integer values. Our task is to find the first repeating element in an array of integers.We need to find the first integer value from the array which occurred more than once in the array.Let's take an example to understand the ... Read More

Find the first repeated word in a string in C++

sudhir sharma

sudhir sharma

Updated on 27-Jan-2022 10:50:35

1K+ Views

In this problem, we are a string str consisting of comma separated words. Our task is to find the first repeated word in a string.We need to find the first word 'string between two spaces' which gets repeated in the string.Let's take an example to understand the problem, Input : ... Read More

Find the first maximum length even word from a string in C++

sudhir sharma

sudhir sharma

Updated on 27-Jan-2022 10:43:34

885 Views

In this problem, we are a string str consisting of comma separated words. Our task is to find the first maximum length, even word, from a string.We need to find the largest word 'string between two spaces' whose length is maximum and even.Let's take an example to understand the problem, ... Read More

Find the dimensions of Right angled triangle in C++

sudhir sharma

sudhir sharma

Updated on 27-Jan-2022 10:37:20

652 Views

In this problem, we are given two values H and A, denoting the hypotenuse and area of a right angled triangle. Our task is to find the dimensions of the Right angled triangle.Right Angled Triangle is a special type of triangle in which two sides intersect at right angles.Fig : ... Read More

Find the Deepest Node in a Binary Tree in C++

sudhir sharma

sudhir sharma

Updated on 27-Jan-2022 09:15:56

696 Views

In this problem, we are given a binary tree. Our task is to find the Deepest Node in a 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 two children.Deepest node ... Read More

Find the average of first N natural numbers in C++

sudhir sharma

sudhir sharma

Updated on 27-Jan-2022 09:08:26

1K+ Views

In this problem, we are given a number n. Our task is to find the average of first N natural numbers.Average of numbers is defined as the sum of all numbers divided by the total number of numbers.Average of N natural numbers is defined as the sum of first N ... Read More

Find the arrangement of queue at given time in C++

sudhir sharma

sudhir sharma

Updated on 27-Jan-2022 09:02:17

218 Views

In this problem, we are given a string consisting of characters 'M' and 'F' only and a time t. Our task is to find the arrangement of the queue at a given time.The string defines people standing in a common queue to enter the bus. All males in the queue ... Read More

Advertisements