In this lab assignment, we practice working with dynamic arrays, working with class template, and understanding testcases, and finishing the sortedList implementation.
Note that this is labelled as Lab5, but it is actually the fourth lab of the semester.
From your terminal (mac or WSL/Ubuntu) window, you can use the following command to download it:
git clone https://github.com/CISC2200-Fall-24-Fordham/Lab5.git
If you haven't done so already, please set up programming environment your own computer, by following Setup Tutorial.
-
The Commannd Line Tools are required.
-
The C++ Dev Environment (VSCode) is highly recommened.
Please follow these tutorials closely and carefully.
Please implement the following member functions in the AList.h.
- Implement remove(i) member function of SortedAList.
- Implement put(ItemType item) member function of SortedAList. You can use the binary_search_insertpos function (given in the slides) to find the insertion point, or use simple linear search.
- Understand how binary_search works (by using VSCode debugger), and use it to implement find member function.
- (Optional) Test your functions by adding more testcases scenarios to main.cpp.
You may want to create your own doctest based tests to aide in debugging / testing your implementation. Consult the Project for reference implementations of tests with doctest.
Submit your SortedAList.h file at the following link by Wednesday Nov 6th, midnight (11:59pm). Lab5 submission link
The autograder compiles and tests your programs using some testcases that are different from those in main.cpp. If your program fails some testcases, go back to review your code, and test your member functions with different inputs.