![]() |
VOOZH | about |
The list:push_back() function in C++ STL is used to add a new element to an existing list container. It takes the element to be added as a parameter and adds it to the list container.
list_name.push_back(value)
The below program illustrates the list::push_back() function.
Initial Size of the list: 0 Size of list after adding three elements: 3
Time Complexity: O(1)
Auxiliary Space: O(1)