Why in
as3.c do we need to declare and set the head and tail pointers to null?
Shouldn't Queue.c keep
track and take care of all that for us?
Ø Passenger
function must call enqueu function and bus function
must call dequeue function. Those are requirements of
the assignment. You need to initialize the queue by sending in the addresses of
the head and tail and input data itemtype(i.e. &head and &tail &inputnode)
to passenger and bus functions.
I
thought we should just have to call the enqueue
function and pass in the new itemtype
we create from reading the input.
Ø The main
function calls passenger and bus functions. If anyone’s main function calls enqueue or dequeue
functions, one would get 0 for the program.
Why are we having to send in the current head and tail pointers
when the linked list should be handling that by itself.
>main function never knows
queue data structure. Your program uses passenger and bus functions to hide the
details of implementation.
Why
is the item in Queue.c an integer
and not an itemtype arrivial_struct.
Ø You declare
in main function
Itemtype inputnode
To use in passenger and bus functions
But
You use
Itemptr->count
and/or itemptr->time
in enqueue and passenger and bus functions.