LISTS In C

In this article, we will be focusing List in C++ in detail.

Standard Template Library is a generic library that comprises of different c++ template classes. It includes various classes and methods that can operate on different types of data records/values.

By this, we mean that, we need not define classes and methods over and over to perform the same operation on different data type values.

The basic components of Standard Template Library is:

  • Containers
  • Iterators
  • Algorithms

Today, we will be focusing on lists that come under Containers. So, let us begin!

What is a List in C++?

list is part of a container is a component of the Standard Template Library that enables the programmer to create and store data values of different data types.

There are different types of Containers as follows:

  • Sequence Containers
  • Associative Containers
  • Container Adapters
  • Unordered Associative Containers

List is a Sequential Container that enables us to store and work with different types of data values. Sequential Containers allow the programmer to access the data values of varied data types in a sequential manner only.

Thus, lists work upon the storage of data in non-contiguous memory locations and access the values in a sequential manner.

Lists allows us to insert and delete the data values from any particular memory location. Moreover, we can access the elements of the lists in a bi-directional manner but in a sequential way.

With Lists, we can store data elements at varied locations in different chunks of memory. The lists can shrink and expand through both the ends at dynamic runtime as per the need.

#c++ #programming-c #cplusplus

List in C++ Standard Template Library
2.95 GEEK