"Completed" PA05

(aka don't want to spend anymore time on it)
+- ArrayDataEngine.c
+- IteratorUtility.c
+- QueueUtility.c
+- StackUtility.c
This commit is contained in:
Charles Descamps 2023-10-04 17:25:56 -07:00
parent a9a217cc45
commit 770212bc8e
5 changed files with 75 additions and 45 deletions

View file

@ -64,8 +64,9 @@ Dependencies: getItemAtIndex, getListSize
*/
bool peekFront( StateDataType *returnVal, const QueueType queue )
{
// return false (TEMP)
return false;
// use getListSize to get the 'front' value
// use getItemAtIndex to 'see' the value at the front.
return getItemAtIndex(returnVal, queue, getListSize(queue));
}
/*
@ -82,8 +83,9 @@ Dependencies: removeItemAtIndex, getListSize
*/
bool dequeue( StateDataType *returnVal, QueueType *queue )
{
// return false (TEMP)
return false;
// get the "front" of the queue
// remove the value in the queue and return success/failure
return removeItemAtIndex(queue, returnVal, getListSize(*queue));
}
/*
@ -99,6 +101,6 @@ Dependencies: insertItemAtIndex
*/
bool enqueue( QueueType *queue, const StateDataType toBePushed )
{
// return false (TEMP)
return false;
// return function success/failure based on inputs
return insertItemAtIndex(queue, toBePushed, 0);
}