moabid42 / ft_containers

An implementation of some containers of the STL library (vector and map).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ft_containers

Resources

  1. https://cplusplus.com/reference/stl/
  2. https://github.com/gcc-mirror/gcc/tree/master/libstdc%2B%2B-v3/include/bits
  3. https://github.com/llvm-mirror/libcxx/tree/master/include

Red–black tree

  1. https://edutechlearners.com/download/Introduction_to_algorithms-3rd%20Edition.pdf
  2. https://algorithmtutor.com/Data-Structures/Tree/Red-Black-Trees/
  3. https://www.youtube.com/watch?v=qvZGUFHWChY&list=PLwyTr3n29dXRDviK2r4fcF_9lr8pL1tlr
  4. specific type of balanced binary search trees

Rules:

  • a node is either red or black
  • root and leaves (NIL) are black
  • if a node is red, its children are black
  • all paths from a node to its NIL descendants contain the same number of black nodes
  • longest path is no more than twice the length of the shortest path
    • shortest: all black nodes
    • longest: alternating red and black

Operations:

  • all operations have a time complexity of O(log n)
  • Search
  • Insert, require rotation
  • Remove, require rotation

About

An implementation of some containers of the STL library (vector and map).


Languages

Language:C++ 98.8%Language:Makefile 1.2%