Aman Kumar has Published 94 Articles

Find total number of distinct years from a string in C++ Program

Aman Kumar

Aman Kumar

Updated on 07-Aug-2025 16:06:02

716 Views

In this article, we will write a C++ program to find the total number of distinct years from a string. Here, we have a string that contains the words and the dates. Our task is to find the number of distinct years mentioned. Let's see the following example scenario to ... Read More

Find the first, second and third minimum elements in an array in C++ program

Aman Kumar

Aman Kumar

Updated on 06-Aug-2025 16:23:21

595 Views

In this article, we need to identify the three minimum elements in an array: minimum, second minimum, and third minimum. We will look at two different approaches to solve this problem and compare their time complexity. Problem Statement Given an array of n elements, we need to find the first, ... Read More

Order of evaluation in C++ function parameters

Aman Kumar

Aman Kumar

Updated on 04-Aug-2025 16:02:00

237 Views

In C++, when we pass multiple arguments to a function, a common question arises, in what order are these arguments evaluated? Is it from left to right, right to left, or does it depend on the compiler? In this article, we will learn how function parameter evaluation works in C++, ... Read More

What does the operation c=a+++b mean in C/C++?

Aman Kumar

Aman Kumar

Updated on 30-Jul-2025 15:03:20

2K+ Views

In C/C++, the expression c = a++ + b indicates that the current value of a is added to b, and the result is assigned to c. After this assignment, a is incremented by 1 (post-increment), which means the increment of a happens after its value is used in the ... Read More

Angle between two Planes in 3D in C Program?

Aman Kumar

Aman Kumar

Updated on 30-Jul-2025 14:13:45

162 Views

In 3D geometry, planes are flat surfaces extending infinitely in space. When two planes intersect, they form a line, and the angle between them becomes an important geometric measure. In this article, we will learn how to calculate the angle between two planes in 3D space using a C program. ... Read More

Print level order traversal line by line in C++ Programming.

Aman Kumar

Aman Kumar

Updated on 30-Jul-2025 13:09:16

385 Views

Level Order Traversal, also known as Breadth-First Search (BFS), is a method of traversing a tree where nodes are visited level by level, starting from the root node and moving left to right within each level. In this article, our task is to print the nodes of a binary tree ... Read More

3-way Merge Sort in C++

Aman Kumar

Aman Kumar

Updated on 29-Jul-2025 16:22:31

2K+ Views

Merge sort is a popular sorting algorithm that follows the divide-and-conquer strategy. It works by recursively dividing the input array into two halves, sorting each half, and then merging them. With a time complexity of O(n log n). 3-Way Merge Sort An optimized variation of merge sort is the 3-way ... Read More

3Sum Closest in C++

Aman Kumar

Aman Kumar

Updated on 29-Jul-2025 15:18:00

1K+ Views

The 3 Sum Closest problem involves finding the sum of three numbers in an array that is closest to a given target value. We are given an integer array nums of length n and an integer target. Our goal is to find three integers in the array such that their ... Read More

Area of a n-sided regular polygon with given side length in C++

Aman Kumar

Aman Kumar

Updated on 29-Jul-2025 14:47:49

1K+ Views

A regular polygon with n sides is a two-dimensional shape with n equal-length sides and n equal interior angles. It is both equilateral and equiangular (all sides are equal and all angles are equal). In the above diagram, we see that the polygon can be divided into n equal ... Read More

Area of a polygon with given n ordered vertices in C++

Aman Kumar

Aman Kumar

Updated on 29-Jul-2025 14:39:53

988 Views

A polygon is a closed two-dimensional shape formed by connecting three or more straight lines end-to-end. These lines form sides, and their connection points are called vertices. When the vertices of the polygon are given in a specific order either clockwise or counter-clockwise, we can calculate the area of the ... Read More

1 2 3 4 5 ... 10 Next
Advertisements