list::push_front() and list::push_back() in C++ STLWe know that the C++ programming language is blessed with the pre-defined implementation of Data Structures and Algorithms in its Standard Template Library (STL); if not present, we need to write the whole code, which takes a lot of compilation time for the compiler and a time-consuming process for the programmer sitting opposite to the PC. The list is one such important Data Structure which is treated as a Container helping us to store the data, which can be of any data type like int, char, string, long, short etc. The push_front() operation helps us add the elements to the List Data Structure we have created, and the push_back() function allows us to add up the features or the data from the back of the List Data Structure. Syntax C++ code Output: / t m p / d J J Y Z f g 6J u.o // Output of the List created 6 1 2 3 4 5 C++ code Output: / t m p / d J J Y Z f g 6J u.o 6 7 24 43 45 58 89 C++ code Output: / t m p / d J J Y Z f g 6J u.o 1 2 3 4 5 6 C++ code Output: 6 7 24 43 45 58 89 |
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week