Skip to content

Tag Archives: STL

Given an array arr[] of size N having distinct integers from 1 to N, the task is to count the minimum number of steps required… Read More
Forward list in standard template library of C++. It comes under #include<forward_list> header file. It is implemented as a singly linked list. It was introduced… Read More
An array is a collection of items stored at contiguous memory locations. It is to store multiple items of the same type together. This makes… Read More
An Adjacency List is used for representing graphs. Here, for every vertex in the graph, we have a list of all the other vertices which… Read More
A Set is a collection of distinct elements. Elements cannot be modified once added. There are various operations associated with sets such as union, intersection,… Read More
Given a queue q[] and an integer K, the task is to define a method to remove a specific element from the queue q[]. If… Read More
In this article, we will discuss how to implement a Stack using list in C++ STL. Stack is a linear data structure which follows. LIFO(Last… Read More
Given N persons are standing in a circle and an integer K. If initially starting from the first position, the Kth alive person clockwise from… Read More
Given a set S consisting of N integers and an element K, the task is to find the index of the element K in the… Read More
In C++, vectors are dynamic arrays, that can grow or shrink and their storage is handled by the container itself. There are two ways of… Read More
Design a data structure that supports the following operations in queue efficiently: push__front(x): Insert an element at the front of the queue. push__middle(x): Inserts element… Read More
find(): The find() function is used to search the element in the given range and every STL container has the functionality to search the element… Read More
In this article, we will discuss the time and space complexity of some C++ STL classes. Characteristics of C++ STL: C++ has a low execution… Read More
Prerequisite: Vectors in C++ STL Vectors are known as dynamic arrays with the ability to resize themselves automatically when an element is inserted or deleted,… Read More
Given a string S and a character C, the task is to remove all the occurrences of the character C from the given string. Examples:… Read More