Commit 75f394d7 authored by Matthew P. Russell's avatar Matthew P. Russell
Browse files

Update ArrayList.cpp

parent 5e195083
......@@ -11,9 +11,10 @@
/*
* name: ArrayList default constructor
* purpose: initialize the ArrayList
* arguments: none
* returns: none
* effects: initializes the ArrayList, sets capacity to 10, and size to 0
* effects: sets capacity to 10, and size to 0
*/
ArrayList::ArrayList() {
......@@ -21,10 +22,10 @@ ArrayList::ArrayList() {
/*
* name: ArrayList destructor
* purpose: free memory associated with the ArrayList
* arguments: none
* returns: none
* effects: frees memory associated with the ArrayList, and sets size and
capacity to 0
* effects: sets size and capacity to 0
*/
ArrayList::~ArrayList() {
......@@ -32,9 +33,10 @@ ArrayList::~ArrayList() {
/*
* name: insert
* purpose: insert the provided integer into the ArrayList
* arguments: an integer to insert
* returns: none
* effects: inserts x into the ArrayList, and increases size of ArrayList by 1
* effects: increases size of ArrayList by 1
*/
void ArrayList::insert(int x) {
......@@ -42,9 +44,10 @@ void ArrayList::insert(int x) {
/*
* name: remove
* purpose: remove the provided integer from the ArrayList
* arguments: an integer to remove
* returns: none
* effects: removes x from the ArrayList, and decreases size of ArrayList by 1
* effects: decreases size of ArrayList by 1
*/
void ArrayList::remove(int x) {
......@@ -52,6 +55,7 @@ void ArrayList::remove(int x) {
/*
* name: find
* purpose: determine if the provided integer is within the ArrayList
* arguments: an integer to find
* returns: returns true if x is in the ArrayList, false otherwise
* effects: none
......@@ -62,6 +66,7 @@ bool ArrayList::find(int x) {
/*
* name: numitems
* purpose: determine the number of items in the ArrayList
* arguments: none
* returns: returns the size of the ArrayList
* effects: none
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment