Skip to content

C0M-M4ND0/ft_containers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft_containers

Implementation of a few c++ container using c++98

see the en.subject.pdf

1_zwYif2fwfrRmqonno8hHGQ

Final grade : 125/100

Mandatory part : 100/100

Bonus : 25/25

Description

This repository contains a C++ implementation of several commonly used STL containers, including vector, stack, map, and set. The implementation is written in C++98 and is intended to be compatible with older compilers.

Each container is implemented as a separate class, with a similar interface to the corresponding STL container including the iteartor to each container that need an iterator ...

The containers are implemented using templates, so they can store any type of object. However, there are some limitations on the types that can be stored, such as restrictions on copy constructors and assignment operators.

This implementation is intended to be a learning resource for those who want to understand how the STL containers work under the hood, as well as a reference for those who need to use a subset of the containers in an older codebase.

The set and map containers are implemented using a Red-Black Tree. the Red-Black Tree implementation is included in the red-black_tree.hpp header file, and is used by the set and map containers to maintain their order and perform fast lookups. The tree is balanced and self-adjusting, ensuring efficient operations even for large datasets.

Test

The implementation has been tested using the ft_containers-unit-test, which can be found at https://github.com/divinepet/ft_containers-unit-test. The tests cover a wide range of scenarios and edge cases, and are designed to ensure that the containers behave correctly and efficiently.

In addition to the unit tests, I have included some additional tests in the tests directory. These tests cover some additional scenarios and edge cases, and can be run using make and the appropriate command line arguments. The available tests are:
main -v: Runs tests for the vector container.
main -st: Runs tests for the stack container.
main -s: Runs tests for the set container.
main -m: Runs tests for the map container.
Optional [-fast] argument can be added to run a fast version of the tests.

Don't forget to report to me the Errors in the project and also your suggestions about it .... to make it better 😉

Gmail Badge Twitter Badge Facebook Badge

About

Implementation of a few c++ container

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published