These are my test cases for my semester project (Data Structure Library) in my data structures and algorithms class. It includes test cases for circular dynamic arrays, red black trees, binary heaps, and binomial heaps written in C++.
Each data structure has its own folder, inside each folder you will find a folder for each test case which contains a main cpp file and the correct output.
- Binary Heap (Heap)
- This will use a queue to test peekKey and extractMin after 10000 inserts.
- This will test templates and copy constructors.
- Binomial Heap (BHeap)
- This will use a queue to test peekKey and extractMin after 10000 inserts.
- This will test merge after constructing various heaps.
- This will test templates and copy constructors.
- Circular Dynamic Array (CDA)
These test cases test for correctness already so they do not come with output files. There is a makefile in the CDA folder to compile these files.- This will test a few irregular cases that could potentially break your CDA.
- This will test the runtimes of the add and delete operations. (irrelevant now due to the grading script linked below)
- Red Black Tree (RBTree)
- This will test all functions one by one.
- This will test templates then insertions and deletions.
- This will test deletions after inserting 100 elements.
- Either place your makefile and respective DS.cpp file into a test case folder or move the Main.cpp file to your own folder containing makefile and respective DS.cpp file.
- Run your makefile then run your executable
- Verify your output with the correct output files given.
Alternatively you can use my project grader found here to simulate grading similar to submission grading. I highly recommend using this project grader on the cs-intro server to test your projects.
To my knowledge, the projects slightly change every semester, the general data structure should be the same (some dynamic array, some balanced tree, some form of heaps). There is no guarantee that a perfect score on my test cases will yield a perfect score on your actual project grade because of this. In any case you should use these as a base for testing files and build more test cases or build on top of these to fully check the correctness of your data structures.
Additionally, some extra userscripts for usfca's visualizers that will probably help you check your test cases will be linked below:
You can either use greasemonkey to install them or follow the instructions in the comments to paste the code into the javascript console of your browser.