Farhan Muhamed has Published 147 Articles

C++ Program to Show the Duality Transformation of Line and Point

Farhan Muhamed

Farhan Muhamed

Updated on 16-Jun-2025 18:09:29

240 Views

The duality transformation is concept in computational geometry that maps coordinate points to lines and lines to coordinate points. In this article, we will learn all about the duality transformation of lines and points, and implement C++ code to show this transformation. What is Duality Transformation? The duality transformation ... Read More

Tokenizing a string in C++

Farhan Muhamed

Farhan Muhamed

Updated on 13-Jun-2025 18:51:05

6K+ Views

Tokenization refer to the process of breaking a string based on certain delimiters such as spaces, commas, semicolons, or any other character. Mostly white spaces are used as delimiters to tokenize strings. In this article, we will discuss all the ways tokenize a string in C++. For example, if we ... Read More

C++ Program to Check Whether Topological Sorting can be Performed in a Graph

Farhan Muhamed

Farhan Muhamed

Updated on 13-Jun-2025 18:50:30

656 Views

In this article, we will learn what is topological sorting, how to use it to detect cycles in a directed graph, and how to implement it in C++. What is Topological Sort? Topological sorting is an operation used to detect cycle in a graph. In this operation we order ... Read More

C++ Program to print the diamond shape

Farhan Muhamed

Farhan Muhamed

Updated on 12-Jun-2025 17:26:36

568 Views

In this article, we will learn how to print a diamond shape with 2n rows and n columns for a given size n using C++. For example, if n = 4, the diamond shape will look like this: Algorithm to Print Diamond Shape To print the ... Read More

C++ Program to Check if any Graph is Possible to be Constructed for a Given Degree Sequence

Farhan Muhamed

Farhan Muhamed

Updated on 12-Jun-2025 17:23:27

171 Views

We are given an array of integers containing the degree of each vertex in a graph. Our task is to check if it is possible to construct a graph with the given degree sequence. Example: int degrees[] = {3, 2, 2, 0} Output: Not Possible Explanation: The first ... Read More

C++ Program to Demonstrate the Implementation of 4-Color Problem

Farhan Muhamed

Farhan Muhamed

Updated on 11-Jun-2025 18:42:06

712 Views

In this article, we will explain the 4 color problem to color a graph and implement the backtracking algorithm to solve it in C++. The 4 Color Problem The 4-color problem states that the maximum number of colors needed to color any planar graph (or a 2D map) is ... Read More

C++ Program to Solve the Dominating Set Problem

Farhan Muhamed

Farhan Muhamed

Updated on 10-Jun-2025 17:59:20

423 Views

In this article, we will explain the dominating set problem and implement it's solution in C++. First of all, let's understand what a dominating set is. Dominating Set of a Graph A dominating set for a graph is a subset of the set of all the vertices. Every vertex ... Read More

C++ Program to Generate a Random Subset by Coin Flipping

Farhan Muhamed

Farhan Muhamed

Updated on 10-Jun-2025 17:58:34

274 Views

The subsets of a set refers to all the possible combinations of choosing elements from the set. For example, if we have a set {1, 2}, the subsets are {}, {1}, {2}, and {1, 2}. In this article, we will learn how to generate a random subset for a set ... Read More

C++ Program to Implement the Binary Counting Method to Generate Subsets of a Set

Farhan Muhamed

Farhan Muhamed

Updated on 09-Jun-2025 19:09:42

1K+ Views

The subsets of a set refers to all the possible combinations of choosing elements from the set. For example, if we have a set {1, 2}, the subsets are {}, {1}, {2}, and {1, 2}. In this article, we will learn how to generate subsets of a set using the ... Read More

How to remove certain characters from a string in C++?

Farhan Muhamed

Farhan Muhamed

Updated on 09-Jun-2025 19:09:19

88K+ Views

In this section, we will see how to remove some characters from a string in C++. In C++ we can do this task very easily using erase() and remove() function. The remove function takes the starting and ending address of the string, and a character that will be removed. // ... Read More

Previous 1 ... 4 5 6 7 8 ... 15 Next
Advertisements