/42-Containers

Implementation C++ STL containers

Primary LanguageC++

📖 Containers

Implementation C++ STL containers

GitHub code size in bytes Number of lines of code Code language count GitHub top language GitHub last commit

Summary

This is a project to re-implement some C++ STL Containers to understand them.

Some requirements for this project are as follow:

Re-implement (The documents below are written in Korean.)

Mandatory

Bonus

What is STL? [1]

The Standard Template Library (STL) is a set of C++ template classes to provide common programming data structures and functions such as list, stack, vector, etc [1]

STL has four components

This project is designed to implement a few containers, functions, and iterators in the C++98.

Algorithms

The header algorithm defines a collection of functions especially designed to be used on ranges of elements. They act on containers and provide means for various operations for the contents of the containers. [1]

Algorithms

  • Sorting
  • Searching
  • partition
  • etc.

Containers

Containers or container classes store objects and data. There are in total 7 standard "first-class" container classes and 3 container adaptor classes and only seven header files that provide access to these containers or container adaptors. [1]

sequence containers container adaptors associative containers unordered associative containers(c++11)
implement data structures which can be accessed in a sequential manner. provide a different interface for sequential containers. implement sorted data structures that can be quickly searched(O(long n) complexity). implement unordered data structures that can be quickly searched
vector queue set unordered_set (c++11)
list priority queue multiset unordered_multiset (c++11)
deque stack map unordered_map (c++11)
arrays(c++11) multimap unordered_multimap (c++11)
forward lists(c++11)

Flowchart of Adaptive containers and Unordered Containers [1]

Flowchart of Adaptive containers and Unordered Containers

Flowchart of Sequence containers and Ordered Containers [1]

Flowchart of Sequence containers and Ordered Containers

Functions(Functor)

The STL includes classes that overload the function call operator. Instances of such classes are called function objects or functors. Functors allow the working of the associated function to be customized with the help of parameters to be passed. [1]

Iterators

As the name suggests, iterators are used for working upon a sequence of values. They are the major feature that allow generality in STL. [1]

Reference

index title author last modified accessed url status
1 The C++ Standard Template Library (STL) GeeksforGeeks 19 Nov, 2021 15 May, 2022 ok