Arnab Chakraborty has Published 4427 Articles

How to delete an element from the Set by passing its value in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 21-Feb-2025 16:31:34

769 Views

In this article, we will explain how to delete an element from a set in C++ by passing its value. A set stores elements in sorted order, where each element is unique and cannot be modified once added. While the values cannot be changed, we can add or remove elements ... Read More

All reverse permutations of an array using STL in C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 21-Feb-2025 16:30:01

268 Views

In this problem, we need to generate all reverse permutations of a given array using C++'s Standard Template Library (STL). A permutation is simply rearranging the elements of the array in every possible order. For example, with an array of three elements, there are six possible ways to arrange them. ... Read More

How to sort an Array using STL in C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 21-Feb-2025 16:25:55

2K+ Views

The problem is to sort an array using C++'s Standard Template Library (STL). Sorting an array means rearranging its elements in a specific order. In this case, we aim to sort the elements in both ascending and descending order, using the built-in functionalities of the STL. Let's say we have ... Read More

C program to reverse an array elements

Arnab Chakraborty

Arnab Chakraborty

Updated on 14-Feb-2025 18:05:30

92K+ Views

Reversing an array means changing the order of its elements so that the first element becomes the last, the second becomes the second last, and so on. This operation is commonly used in applications such as data manipulation or algorithms that require elements to be in reverse order. For example, ... Read More

How to find the maximum element of an Array using STL in C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 14-Feb-2025 18:04:33

4K+ Views

In C++, one common task is to find the largest number in an array. An array is just a collection of values, and sometimes we need to find the highest value in that collection. For example, consider the array: int arr[] = {11, 13, 21, 45, 8}; In this ... Read More

C++ program to convert the string into an integer

Arnab Chakraborty

Arnab Chakraborty

Updated on 09-Dec-2024 18:40:33

12K+ Views

C++ is a statically typed language. To write programs we need to define variables of specified types. Sometimes we need to read inputs from the console or files. In such a scenario the string data are read into the program. To convert them into other datatypes needs special operations. In ... Read More

5 Different methods to find length of a string in C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 05-Dec-2024 13:57:43

11K+ Views

Here we will see five different ways to get the string lengths in C++. In C++ we can use the traditional character array string, and C++ also has String class. In different area there are different methods of calculating the string lengths. The C++ String class has length() and size() ... Read More

Matrix Chain Multiplication (A O(N^3) Solution) in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Dec-2024 11:54:42

3K+ Views

If a chain of matrices is given, we have to find a minimum number of correct sequences of matrices to multiply. We know that the matrix multiplication is associative, so for four matrices ABCD, we can multiply A(BCD), (AB)(CD), (ABC)D, and A(BC)D, in these sequences. Like ... Read More

What are the differences between bitwise and logical AND operators in C/C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Dec-2024 11:54:26

7K+ Views

As we know the bit-wise AND is represented as ‘&’ and the logical operator is represented as ‘&&’. There are some fundamental differences between them. These are as follows − bitwise AND operator The bitwise AND (&) operator performs a bit-by-bit AND operation between two integers. The bitwise AND operator ... Read More

Find All Duplicates in an Array in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Dec-2024 00:25:56

11K+ Views

Suppose we have an array of integers, in range 1 ≤ a[i] ≤ n (n = size of an array), here some elements appear twice and others appear once. We have to find all the elements that appear twice in this array. So if the array is [4, 3, 2, ... Read More

1 2 3 4 5 ... 443 Next
Advertisements