Aman Kumar has Published 94 Articles

C++ Program to Implement Bitap Algorithm for String Matching

Aman Kumar

Aman Kumar

Updated on 20-May-2025 19:24:35

485 Views

The bitap algorithm is fuzzy string matching algorithm that is used to find approximate matches between a pattern and a text. The algorithm determines whether a given text contains a substring that is "approximately equal" to a given pattern, where approximate equality is defined in terms of Levenshtein distance (or number ... Read More

cout << endl vs cout << \\"\\" in C++

Aman Kumar

Aman Kumar

Updated on 20-May-2025 18:50:02

1K+ Views

In C++, both count

C++ Program to find kth Smallest Element by the Method of Partitioning the Array

Aman Kumar

Aman Kumar

Updated on 20-May-2025 18:48:23

319 Views

In this articles we will find the kth Smallest Element by Partitioning the Array in C++, let's see input/output scenario: Input / Output Scenario Following is the input-output scenario: Input: arr[] = {7, 2, 1, 6, 8, 5, 3, 4} Output: 3 In the above scenario, after sorting the ... Read More

C++ Program to find the maximum subarray sum O(n^2) time (naive method)

Aman Kumar

Aman Kumar

Updated on 20-May-2025 18:47:14

352 Views

A subarray is a contiguous slice of an array, and maintains the order of elements naturally. (i.e., the elements of the subarray occupy consecutive positions). For example, the subarrays of an array {1, 2, 3} are {1}, {1, 2}, {1, 2, 3}, {2}, {2, 3}, and {3}. Input / Output ... Read More

C++ Program to Implement B+ Tree

Aman Kumar

Aman Kumar

Updated on 16-May-2025 17:14:30

3K+ Views

A B+ tree is an m-tree that consists of a root, internal nodes, and leaves. The root may be a leaf or a node with two or more children. A B+ tree is an advanced data structure that extends the B-tree by adding a linked list of leaf nodes. A ... Read More

Why is a C++ pure virtual function initialized by 0?

Aman Kumar

Aman Kumar

Updated on 16-May-2025 17:10:40

3K+ Views

In C++, the pure virtual function is initialized with = 0 to indicate that it must be overridden by the derived class and has no implementation in the base class. A pure virtual function is a virtual function in C++ declared in a base class that has no implementation within ... Read More

Why do we need a pure virtual destructor in C++?

Aman Kumar

Aman Kumar

Updated on 16-May-2025 17:09:11

923 Views

Need a pure virtual destructor in C++In C++, the main factor where a pure virtual destructor is needed are with abstract classes and polymorphism. It make sure proper clean-up and avoids memory leaks when working with objects of derived classes through base class pointers. If a class has a virtual ... Read More

Default virtual behavior in C++ vs Java

Aman Kumar

Aman Kumar

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

212 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

311 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

162 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

Advertisements