Skip to content

Tag Archives: cpp-list

The ‘fill’ function assigns the value ‘val’ to all the elements in the range [begin, end), where ‘begin’ is the initial position and ‘end’ is… Read More
Given a List, the task is to delete a range of values from this List using Iterator. Example: Input: list = [10 20 30 40… Read More
Lists are sequence containers that allow non-contiguous memory allocation. As compared to vector, list has slow traversal, but once a position has been found, insertion… Read More
Given a List, the task is to remove the last element from this List in C++. Examples: Input: list = [10 20 30 70 80… Read More
list::get_allocator() is an inbuilt in function in C++ STL which is used to get allocator of container list. Syntax: Allocator_type get_allocator() Parameters: This function does… Read More
Given an N-ary tree, print all the levels with odd and even number of nodes in it.  Examples:  For example consider the following tree 1… Read More
Given two arrays A and B of positive integers, elements of array B can be mapped to elements of array A only if both the… Read More
The list::insert() is used to insert the elements at any position of list. This function takes 3 elements, position, number of elements to insert and… Read More
list in STL is used to represent a linked list in C++. How to create a nested list. We are given n lists, we need… Read More
list::unique() is an inbuilt function in C++ STL which removes all duplicate consecutive elements from the list. It works only on sorted list. Syntax:  list_name.unique(BinaryPredicate… Read More
The list::crbegin() is a built-in function in c++ STL that returns a constant reverse iterator which points to the last element of the list i.e… Read More
The list::emplace() is a built-in function in C++ STL which extends list by inserting new element at a given position. Syntax: list_name.emplace(position, element) Parameters: The… Read More
The list::merge() is an inbuilt function in C++ STL which merges two sorted lists into one. The lists should be sorted in ascending order. If… Read More
The list::cbegin() is a built-in function in C++ STL which returns a constant random access iterator which points to the beginning of the list. Hence… Read More
The list::splice() is a built-in function in C++ STL which is used to transfer elements from one list to another. The splice() function can be… Read More

Start Your Coding Journey Now!