Skip to content

Repository files navigation

Data Structures and Algorithms

C++ implementations of common abstract data types.

For Students

Your Assignment

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

How to Work

  1. Navigate to your assigned folder (e.g., cd Bag)
  2. Implement the methods in the .cpp files (the ones without "Test" in the name)
  3. Compile locally: g++ -std=c++17 -o tests *.cpp
  4. Run tests: ./tests
  5. Push your changes to trigger the CI

Important Notes

  • 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)

For Instructors

Setup Instructions

1. Create Private Tests Repository

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.

2. Create Personal Access Token (PAT)

  1. GitHub -> Settings -> Developer settings -> Personal access tokens -> Tokens (classic)
  2. Generate new token with repo scope
  3. Set expiration to end of semester
  4. Copy the token

3. Add Secret to Student Repository

  1. Go to this repo's Settings -> Secrets and variables -> Actions
  2. New repository secret: DSA_PAT
  3. Paste the PAT

4. Update Workflow Files

In all .github/workflows/test-*.yml files, replace cs-ubbcluj-ro with your GitHub username.

How It Works

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

Security

  • Students cannot access the private tests repo
  • Students cannot see the DSA_PAT secret
  • Even if students modify test files locally, CI always uses official versions

About

Test repo for DSA

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages