C++ implementations of common abstract data types.
Each lab, you will implement one data structure. Navigate to the assigned folder:
| Lab | Folder | Description |
|---|---|---|
| 1 | Bag/ |
Unordered collection with duplicates |
| 2 | Set/ |
Unordered collection without duplicates |
| 3 | Map/ |
Key-value pairs |
| 4 | MultiMap/ |
Key to multiple values |
| 5 | Stack/ |
LIFO structure |
| 6 | Queue/ |
FIFO structure |
| 7 | PriorityQueue/ |
Priority-based queue |
| 8 | Matrix/ |
2D sparse matrix |
| 9 | IndexedList/ |
List with index access |
| 10 | IteratedList/ |
List with iterator |
| 11 | SortedBag/ |
Sorted bag |
| 12 | SortedSet/ |
Sorted set |
| 13 | SortedMap/ |
Sorted key-value pairs |
| 14 | SortedMultiMap/ |
Sorted multi-map |
| 15 | SortedIndexedList/ |
Sorted indexed list |
| 16 | SortedIteratedList/ |
Sorted iterated list |
| 17 | FixedCapBiMap/ |
Fixed capacity bidirectional map |
- Navigate to your assigned folder (e.g.,
cd Bag) - Implement the methods in the
.cppfiles (the ones without "Test" in the name) - Compile locally:
g++ -std=c++17 -o tests *.cpp - Run tests:
./tests - Push your changes to trigger the CI
- Do NOT modify test files (
ShortTest.*,ExtendedTest.*) - The CI uses official test files - your local modifications will be ignored
- Only modify implementation files (e.g.,
Bag.cpp,BagIterator.cpp)
Create a private repository named dsa-private-tests containing the test files:
dsa-private-tests/
├── Bag/
│ ├── ShortTest.cpp
│ ├── ShortTest.h
│ ├── ExtendedTest.cpp
│ └── ExtendedTest.h
├── Map/
│ └── ...
└── (other data structures)
The dsa-private-tests/ folder in this repo is already structured correctly - just push it to a new private repo.
- GitHub -> Settings -> Developer settings -> Personal access tokens -> Tokens (classic)
- Generate new token with
reposcope - Set expiration to end of semester
- Copy the token
- Go to this repo's Settings -> Secrets and variables -> Actions
- New repository secret:
DSA_PAT - Paste the PAT
In all .github/workflows/test-*.yml files, replace cs-ubbcluj-ro with your GitHub username.
Student modifies Bag/Bag.cpp
|
v
Pushes to GitHub
|
v
test-bag.yml triggers (only for Bag/ changes)
|
v
CI fetches official tests from private repo
|
v
Overwrites any student test modifications
|
v
Compiles and runs -> Pass/Fail
- Students cannot access the private tests repo
- Students cannot see the
DSA_PATsecret - Even if students modify test files locally, CI always uses official versions