127 / 187
What is meant by list?
The list is another container that is popularly used. It supports bidirectional, linear list and provides an efficient implementation for deletion and insertion operation. Unlike a vector, which supports random access, a list can be accessed sequentially only.
Write some important member functions of the list class?
Function Task
Back() Gives a reference to the last element
Begin() Gives a reference to the first element
Clear() Deletes all the elements
Empty() Decides if the list is empty or not
End() Gives refernce to the end of the list
Erase() Deletes elements as specified
merge() Merge two ordered list
Insert() Insert elemements as specified
Pop_back() Deletes the last element
Pop_front() Deletes the first element
Push_back() Adds an element at the end
Push_front() Adds an element at the front
Asked In ::
Priyanka Seth
23 Feb, 2019 5:07 AM
Write some important member functions of the list class?
Function Task
Back() Gives a reference to the last element
Begin() Gives a reference to the first element
Clear() Deletes all the elements
Empty() Decides if the list is empty or not
End() Gives refernce to the end of the list
Erase() Deletes elements as specified
merge() Merge two ordered list
Insert() Insert elemements as specified
Pop_back() Deletes the last element
Pop_front() Deletes the first element
Push_back() Adds an element at the end
Push_front() Adds an element at the front