diff --git a/client/src/pages/guide/english/cplusplus/lists/index.md b/client/src/pages/guide/english/cplusplus/lists/index.md index 4b1f3bf812..89239a1874 100644 --- a/client/src/pages/guide/english/cplusplus/lists/index.md +++ b/client/src/pages/guide/english/cplusplus/lists/index.md @@ -12,8 +12,22 @@ whose job is to maintain the order of the list elements kind of like the link be of how Lists are organized compared to Vectors and Arrays. ![img](https://imgur.com/SiU8uTe.png) +Traversal in a list is slow as compared to Vectors and Arrays, but once a position has been found, insertion and deletion are quick. ## How to declare a List If you want to declare a List of Numbers you write: '''std::list Numbers;''' + +## Functions used with List +size() : Returns the number of elements in the list +begin() : Returns an iterator pointing to the first element of the list +end() : Returns an iterator pointing to the theoretical last element which follows the last element +push_front(data) – Adds a new element with value 'data' at the beginning of the list +push_back(data) – Adds a new element with value 'data' at the end of the list +pop_front() – Removes the first element of the list +pop_back() – Removes the last element of the list + +## How to use these Functions + +Numbers.size();