cs-academia

A work in progress; documenting my academia => There are NO DEMOS yet, just the code

View on GitHub

Project 1: Linked Lists

Background Info

You are provided with a C++ implementation of a list Abstract Data Type (ADT) in which some functions are already written and some are not. Your job is to complete the unwritten functions. (In one case you will make modifications to improve the runtime of one already implemented function).

Key Concepts Involved

Development Advice

Project Guide

Examine the file List.h. There you will find an implementation of a List class with some functions not yet implemented; you will find stubs for these functions.

If you search for the string TODO you will find all of the requirements. In most cases each task is the implementation of a particular member function. The one exception is the length function which already exists, but you need to make modifications so that it runs in constant time – these modifications are mostly outside of the length function itself.

To finish the project, completion of all of the TODO items specified is required – associated comments give details on the expectations.

Functions to Write

Function Completion Test Driver
equal_to ✔️ ./tests/t1_eq_to.cpp
count ✔️ ./tests/t2_count.cpp
length ✔️ ./tests/t3_len.cpp
pop_back ✔️ ./tests/t4_pop_back.cpp
prefix ✔️ ./tests/t5_prefix.cpp
filter_leq ✔️ ./tests/t6_filter.cpp
merge_with ✔️ ./tests/t7_merge.cpp
fast_remove_all ✔️ ./tests/t8_rem_all.cpp
concat ✔️ ./tests/t9_concat.cpp
insert_sorted ✔️ ./tests/t10_insert_sorted.cpp
clone ✔️ ./tests/t11_clone.cpp
print_rev ✔️ - N/A - Checked by eye
reverse ✔️ ./tests/t12_reverse.cpp
compare_with ✔️ ./tests/t13_compare.cpp
suffix_maxes ✔️ ./tests/t14_suff_maxes.cpp

Project Structure

This is to be developed in one stage, procedurally. There are several source files provided:

Restrictions for this Project

What You CAN’T Do

What You CAN Do

Note: if you want helper functions that do not have a “calling object” (like in traditional C), you designate them as static.

My Solution in Action

The Linked List deliverable is implmented in List.h; as indicated above, the TEST CASES folder contains tests for the bulk of the functions it implements. The Linked List is of generic type, so it can store ints, strings, etc. To run the tests, head to the TEST CASES folder and run the make command! Then, you can run any of the executables that generates (They will be labelled as indicated above in the table).