# Ritika

## NumPy Array Indexing & Slicing

In this article, we will understand how the indexing and slicing works with NumPy Arrays in Python. What is Indexing in NumPy? Indexing in NumPy is a way to access single or multiple elements from a NumPy array. Each position in NumPy Array has a unique index, which you can use to access its value. […]

## Iterate over a Set in Reverse Order in C++

This tutorial will discuss multiple ways to iterate over a set in reverse order in C++. Table Of Contents Using reverse_iterator Using C++20 Ranges Library Using reverse_iterator In STL, the set class provides a reverse iterator, named reverse_iterator. Using this iterator, we can iterate over the set elements in reverse order. The set function rbegin()

## Skip certain elements while Iterating over a Set in C++

This tutorial will discuss multiple ways to skip certain elements while iterating over a set in C++. Table Of Contents Iterate over Set and skip elements based on Value Iterate over Set and skip elements based on Index Position Iterate over Set and skip elements based on Value Suppose we have a set of numbers

## Find the distance between two Iterators in a Set in C++

This tutorial will discuss how to find the distance between two iterators in a set in C++. In C++, if you have a set containing various numbers and you want to determine the distance between two specific iterators, you can use the std::distance() function from the Standard Template Library (STL). For instance, suppose you have

## Convert Set to a Vector during iteration in C++

This tutorial will discuss multiple ways to convert set to a vector during iteration in C++. Table Of Contents Using Range based for-loop Using std::copy() – STL ALgorithm Using Range based for-loop To convert a set into a vector during iteration, you can iterate over all the elements of the set one by one using

## Modify elements while Iterating over a Set in C++

This tutorial will discuss how to modify elements while iterating over a set in C++. A set contains only unique elements. Moreover, the values in the set act as keys. Once an element is inserted into the set, its value cannot be changed. Modifying its value could disrupt the internal ordering of elements in the

## Difference between begin() and cbegin() of Set in C++

This tutorial will discuss the differences between begin() and cbegin() of set in C++. Table Of Contents begin() function of Set cbegin() function of Set In C++, both begin() and cbegin() are member functions of class set. They both returns an iterator pointing to the first element of the container. However, there’s a subtle difference

## How to Use Lambda function during Set Iteration in C++?

This tutorial will discuss multiple ways to use lambda function during set iteration in C++. Table Of Contents Using std::for_each() and Lambda Function Using Range Based For Loop and Lambda Function Using std::for_each() and Lambda Function Suppose we have a set of integers. If we want to iterate over all the elements in this set

## How to Use Range Based For Loops with Set in C++11 and later?

This tutorial will discuss how to use range based for loops with set in C++11 and later. In C++11, the range-based for loop was introduced. It allows us to iterate over a sequence of elements without explicitly using an iterator or random-access operators. In the range-based for loop, we only need to specify a variable

## What Kind of iterators does a Set provide in C++?

This tutorial will discuss the different kind of iterators a Set provides in C++. Table Of Contents Bidirectional Iterator Const Iterator : const_iterator Reverse iterator Const Reverse iterator In C++, the Set class provides bidirectional iterators. This means we can increment and decrement the iterators, but we cannot perform arithmetic operations on them like we

Scroll to Top