Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

School project: reimplement the STL containers (using allocator, double linked list and AVL binary trees).

NotificationsYou must be signed in to change notification settings

llefranc/42_ft_containers

Repository files navigation

This project was code for MACOS. Here is thesubject.

"C++ containers, easy mode"

Alt text

About

Ft_containers is a project of the mandatory part of the cursus.It's only made in C++ and was about recoding some containers from the STL.

In order to succeed, a good comprehension of howtemplates,iterators,containers andalgorithms work was necessary. Of course, STL is not allowed. That meansyou cannot use <iterator> or even <utility>.

Here are the specificities of the five containers:

  • ➡️Vector: a dynamic array that allows insertion at the end of the container. Elements can be easily access thanks with the corresponding index, but it's not the most optimal container if a lot of insertion / deletion are needed.
  • ➡️List: a circular linked list (with a neutral node linking beginning and end of the list). Better than vector for inserting or deleting elements.
  • ➡️Stack: a container adaptator (LIFO, last in first out).
  • ➡️Queue: a container adaptator (FIFO, first in first out).
  • ➡️Map: a sorted container using an AVL binary tree (auto-equilibrates itself to optimize the time to find a value in the tree), in order to store the datas like in a dictionnary (a key associated to its value).

All my containers use an allocator to manage properly their memory, iterators to access their datas, and handle the same constructors / methods than the containers from the STL in C++98.

Tester

I created a tester withHélène Herin, doing several tests on each of the five mandatory containers. It handles over10000 tests for some containers !

It will test all the constructors, methods and iterators, by comparating your containers with the STL containers, and making a diff if some errors occured.Also, you can choose which tests you want to execute, in the case you're checking specific containers / methods.

✅ If you want to see more, go check it at this repo :https://github.com/llefranc/42_Containator

Sources

About

School project: reimplement the STL containers (using allocator, double linked list and AVL binary trees).

Topics

Resources

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp