The purpose of the program is to implement a character array
list data structure. Lists can begin empty, with one character
with multiple characters, or as a copy of another list.
Clients can then insert, remove, and replace elements in the list.
They can also turn it into a string, a reverse string and
concatenate two lists.
CharArrayList.cpp: Implementation of the CharArrayList class
CharArrayList.h: Class definition and function definition of
the CharArrayList class. The class represents
a char array list data structure.
unit_test.h: Tests made for the functions in CharArrayList.cpp
Makefile: Makes it easier to compile and run files
simple_exception.cpp: Assists in throwing exceptions
timer_main.cpp: "A driver program for timing various
CharArrayList operations"
unit_test both compiles and runs my program
The ADT is an Array List, which is an array with dynamically
allocated memory, so we can change the size after initializing
them, which is a major advantage. Another advantage is that
you can access elements with O(1) efficiency. Some
disadvantages are that when adding and removing elements, we
have to shift other elements to the right of the element we
are adding or removing. This takes up a lot of time the closer
we are to the front of the array list. Another disadvantage is
the time vs space tradeoff when increasing capacity. If you
want to increase capacity while saving time, multiply it.
However, this will take up alot of space. If you want to take
up less space, add onto capacity. However, this will increase
the time it takes as you have more data. The data structure
behing array lists are arrays. We used this because it was the
most similar to array lists, as they are both accessed and
used in similar ways. The only difference is that array lists
can change sinzes. Algorithms include adding and removing
elements along the list, accessing elements, turning elements
into one string, and adding a list to the end of another. One
of the most complex ones in my opinion was the insert at,
because there are a lot of edge cases.