AYUSH MISHRA has Published 134 Articles

First and last position of an element in a sorted array in C++

AYUSH MISHRA

AYUSH MISHRA

Updated on 20-Mar-2025 13:01:33

4K+ Views

The first and last position of any element in a sorted array is a common operation in the world of programming. In C++, there are multiple ways to find the first and last position of an element in a sorted array. In this article, we are going to discuss various ... Read More

C# program to find first set bit

AYUSH MISHRA

AYUSH MISHRA

Updated on 20-Mar-2025 13:01:10

4K+ Views

In this problem, we are given a number n, and we need to find the position of the first set bit (1-bit) in its binary representation. In this article, we are going to discuss different approaches to solving this problem using C#. Example 1 Input: ... Read More

Sort an array which contain 1 to n values

AYUSH MISHRA

AYUSH MISHRA

Updated on 19-Mar-2025 18:54:21

6K+ Views

Sorting an array containing values from 1 to n means arranging the integers in their natural ascending order. This type of sorting problem is commonly encountered in competitive programming (for solving complex problems), where the array is guaranteed to have integers ranging from 1 to n. In this article, ... Read More

C++ program to find the sum of elements between two given indices in array

AYUSH MISHRA

AYUSH MISHRA

Updated on 18-Mar-2025 19:13:17

5K+ Views

Finding the sum of elements between two given indices in an array is a common operation in programming. In C++, there are multiple ways to calculate the sum of elements between two given indices in C++. In this article, we are going to discuss various approaches to calculating the sum ... Read More

C++ Program to Rotate Array Right by One Position

AYUSH MISHRA

AYUSH MISHRA

Updated on 18-Mar-2025 19:12:42

6K+ Views

Rotating an array means shifting its elements in a specific direction while maintaining their relative order. In this article, we will rotate an array right by one position using C++. For example, if the array is {4, 8, 15, 16, 23}, rotating it right once will result in {23, 4, ... Read More

C++ Program to Count the Sum of Numbers in a String

AYUSH MISHRA

AYUSH MISHRA

Updated on 18-Mar-2025 08:20:46

4 Views

In this problem, we are given a string containing alphanumeric characters, and the task is to extract all the numbers from the string and compute their sum. The numbers may appear anywhere within the string, and we need to identify them and add them together. In this article, we are ... Read More

Check if given four points form a square using C++

AYUSH MISHRA

AYUSH MISHRA

Updated on 17-Mar-2025 15:57:29

5K+ Views

A square is a four-sided polygon with all sides equal and all angles equal to 90 degrees. In computational geometry, determining whether four given points form a square is a common problem. In this article, we will discuss multiple approaches to check whether four given points in a 2D plane ... Read More

C++ program to calculate area of circle

AYUSH MISHRA

AYUSH MISHRA

Updated on 17-Mar-2025 15:57:14

4K+ Views

The area of a circle is a fundamental mathematical concept that can be easily calculated using a simple formula. In C++, there are multiple ways to find the area of a circle. In this article, we are going to discuss various approaches to calculating the area of a circle in ... Read More

Python Program for Sum of first N even numbers

AYUSH MISHRA

AYUSH MISHRA

Updated on 17-Mar-2025 13:01:46

5K+ Views

The sum of the first N even numbers is a mathematical operation. In this operation, we add up the firstN even numbers. In Python, there are multiple ways to calculate this sum. In this article, we are going to learn and discuss various approaches to finding the sum of the ... Read More

Python Program to find area of square

AYUSH MISHRA

AYUSH MISHRA

Updated on 27-Feb-2025 09:13:43

0 Views

Problem DescriptionA square is a closed two-dimensional figure having 4 equal sides. Each angle of a square is 90 degrees. The area of a square is the space enclosed within its four sides. In this problem, we are given the side of a square, and we have to find the ... Read More

Advertisements