Purchase Solution

Design a Queue Abstract Data Type Enqueue, Dequeue, Empty

Not what you're looking for?

Ask Custom Question

I need to know how I would do the following program...simple please I have minimal C, C# or C++ background.

Design a queue abstract data type, including operations for enqueue, dequeue, and empty.

Purchase this Solution

Solution Summary

I have added extensive comment to C code. Also added the executable as created by Miracle C.

Solution Preview

I have added extensive comment to C code. Also added the executable as created by Miracle C.

#include <stdio.h>
#include <stdlib.h>
#define FALSE 0

typedef struct linkedlist{ //its a linked list of elements
int dataitem; //We can store an integer data item
struct linkedlist *next; // a pointer to the next item in the queue
} queue; // Queue Abstract Data structure

void Menu (int *choice); //User Menu to enter choices for the Queue
queue *enqueue (queue * Qpointer, int data); //Function to add an item to the tail/end of the queue
queue *dequeue (queue * Qpointer); //Function to get (and delete) an item to the head/beginning of the queue
void printQ (queue *Qpointer); //Print the Queue by starting from the beginning, following the chain of links until the end (NULL) has reached
void empty (queue *Qpointer); //Emtpy/clear the Queue

int main () { //The main() function
queue *Qpointer;
int ...

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.