![]() |
VOOZH | about |
The list::empty() is a built-in function in C++ STL that is used to check whether a particular list container is empty or not. This function does not modify the list, it simply checks whether a list is empty or not, i.e. the size of the list is zero or not.
list_name.empty()
Parameters
Return Value
The below program illustrates the list::empty() function.
Empty List Not Empty
Time Complexity: O(1)
Space Complexity: O(1)
Note: This function works in constant time complexity.