Aman Kumar has Published 37 Articles

Default virtual behavior in C++ vs Java

Aman Kumar

Aman Kumar

Updated on 16-May-2025 17:05:01

167 Views

The default behaviour of virtual functions in C++ and Java is significantly different, especially in terms of the handling of method overriding and polymorphism. Default Virtual Behavior in C++ C++ methods are non-virtual by default. To enable dynamic polymorphism, the virtual keyword must be explicitly used in the base class ... Read More

Template Metaprogramming in C++

Aman Kumar

Aman Kumar

Updated on 16-May-2025 17:02:33

266 Views

C++ Template metaprogramming (TMP)Template metaprogramming (TMP) is a metaprogramming technique in which a template is used by the compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The best use of template metaprogramming is in C++. The ... Read More

C++ Program to implement Slicker Algorithm that avoids Triangulation to find Area of a Polygon

Aman Kumar

Aman Kumar

Updated on 16-May-2025 16:58:55

139 Views

In this article, we implement a C++ program to find the area of a polygon using a slicker algorithm that avoids Triangulation to find the area of a polygon. What is Slicker Algorithm The Silcker algorithm is a method for calculating the area of a polygon by performing a series ... Read More

Print a character n times without using loop, recursion or goto in C++

Aman Kumar

Aman Kumar

Updated on 16-May-2025 16:58:12

1K+ Views

In this article, we will see how to print a character n times without using loops and recursion in C++. Input/Output Scenario Let's see following input output scenario − Input : n = 10, c = 'i' Output : iiiiiiiiii Input : n = 5, character = 'j' Output ... Read More

C++ Program to Check if a Point d Lies Inside or Outside a Circle Defined by Points a, b, c in a Plane

Aman Kumar

Aman Kumar

Updated on 16-May-2025 16:57:30

267 Views

In this articles, we implements a C++ Program to check if a point d lies inside or outside a circle defined by points a, b, c in a plane using the following equation: s = (x-xt)^2 + (y-yt)^2 – r*r Where equation contains the following points: ... Read More

C++ Program to implement Gift Wrapping Algorithm in Two Dimensions

Aman Kumar

Aman Kumar

Updated on 16-May-2025 16:56:07

498 Views

Gift Wrapping AlgorithmThe Gift Wrapping algorithm is also known as Jarvis's march. It is a method for calculating the convex hull of a set of points in a plane. It is essential to find the smallest convex polygon that encloses all the points. Why We Use Gift Wrapping Algorithm? Below ... Read More

C++ Program to Implement Cartesian Tree

Aman Kumar

Aman Kumar

Updated on 16-May-2025 16:54:51

383 Views

Cartesian Tree in C++A Cartesian tree is a binary tree derived from a sequence of distinct numbers. To construct a Cartesian tree, set its root to be the minimum number in the sequence, and then recursively construct its left and right subtrees from the subsequence before and after this number. ... Read More

C++ Program to find Median of Elements where Elements are stored in 2 different arrays

Aman Kumar

Aman Kumar

Updated on 15-May-2025 18:47:19

175 Views

The median is defined as the middle value of a sorted list of numbers, and the middle value is found by ordering the numbers in ascending order. Once the numbers are ordered, the middle value is called the median of the given data set. Here, in this article, we have ... Read More

Calculate range of data types using C++

Aman Kumar

Aman Kumar

Updated on 15-May-2025 16:01:08

4K+ Views

Here, we are going to learn how we can calculate the range of the different C++ data types such as signed data types (int, char, float, etc.) and unsigned data types (unsigned char, unsigned int, unsigned float, etc.). Calculating Range of Signed Data Types In C++, signed data types are ... Read More

Difference between std::vector and std::array in C++

Aman Kumar

Aman Kumar

Updated on 15-May-2025 15:56:01

23K+ Views

Both vectors and arrays are used to store collections of elements, but they differ significantly in how they manage their memory and flexibility. C++ std::vector A vector is a dynamic array that can be resized automatically when elements are added or removed. It is a part of the C++ STL ... Read More

Advertisements