Rheiko
Spell Reviewer
- Joined
- Aug 27, 2013
- Messages
- 4,214
So the story is I had a presentation a few days ago explaining about what is Queue and how it works, like how to do enQueue, deQueue, etc, etc.
After everything's done, the lecturer gave us a task to explain about Queue ADT on a piece of paper. We have never been taught anything regarding ADT yet. So I did my own research and found a lot of information but some of them are this, this, and this.
Even so, I'm still unsure if I have completely grasped the definition of ADT. So I think, ADT is basically processes that work behind the scene, there's no need to know how they work and there are many ways or methods to achieve its goal. So processes like enQueue and deQueue are part of Queue ADT. Please correct me if I'm wrong.
But then we were given this.
So I'm assuming we were given the task to explain about ADT on a piece of paper based on this code...? But I don't really understand the code.
I would be really grateful if anyone could help.
Thanks in advance.
After everything's done, the lecturer gave us a task to explain about Queue ADT on a piece of paper. We have never been taught anything regarding ADT yet. So I did my own research and found a lot of information but some of them are this, this, and this.
Even so, I'm still unsure if I have completely grasped the definition of ADT. So I think, ADT is basically processes that work behind the scene, there's no need to know how they work and there are many ways or methods to achieve its goal. So processes like enQueue and deQueue are part of Queue ADT. Please correct me if I'm wrong.
But then we were given this.
JASS:
//Queue ADT Data Structures
//Queue ADT Type Definitions
typedef struct node
{
void* dataPtr;
struct node* next;
} QUEUE_NODE;
typedef struct
{
QUEUE_NODE* front;
QUEUE_NODE* rear;
} QUEUE;
//Prototype Declarations
QUEUE* createQueue (void);
QUEUE* destroyQueue (QUEUE* queue);
bool dequeue (QUEUE* queue, void** itemPtr);
bool enqueue (QUEUE* queue, void* itemPtr);
bool queueFront (QUEUE* queue, void** itemPtr);
bool queueRear (QUEUE* queue, void** itemPtr);
bool queueCount (QUEUE* queue);
bool emptyQueue (QUEUE* queue);
bool fullQueue (QUEUE* queue);
//End of Queue ADT Definitions
So I'm assuming we were given the task to explain about ADT on a piece of paper based on this code...? But I don't really understand the code.
I would be really grateful if anyone could help.
Thanks in advance.