Deletion of any element from the queue, Data Structure & Algorithms

Program segment for the deletion of any element from the queue

delmq(i)  /* Delete any element from queue i */

{

int i,x;

if ( front[i] == rear[i])

printf("Queue is empty");

{

x = mqueue[front[i]];

front[i] = front[i]-1 ;

return x;

}

}

Posted Date: 4/10/2013 1:40:37 AM | Location : United States







Related Discussions:- Deletion of any element from the queue, Assignment Help, Ask Question on Deletion of any element from the queue, Get Answer, Expert's Help, Deletion of any element from the queue Discussions

Write discussion on Deletion of any element from the queue
Your posts are moderated
Related Questions
Dequeue (a double ended queue) is an abstract data type alike to queue, where insertion and deletion of elements are allowed at both of the ends. Like a linear queue & a circular q

example of stack using flowchart

for i=1 to n if a[i}>7 for j=2 to n a[j]=a{j}+j for n=2 to n a[k]=a[j]+i else if a[1]>4 && a[1] for 2 to a[1] a[j]= a{j]+5 else for 2to n a[j]=a[j]+i ..

Evaluate the frequency counts for all statements in the following given program segment. for (i=1; i ≤ n; i ++) for (j = 1; j ≤ i; j++) for (k =1; k ≤ j; k++) y ++;

The algorithm to delete any node having key from a binary search tree is not simple where as several cases has to be considered. If the node to be deleted contains no sons,

Explain divide and conquer algorithms  Divide  and  conquer  is  probably  the  best  known  general  algorithm  design  method.  It   work according to the following general p

A graph is a mathematical structure giving of a set of vertexes (v1, v2, v3) and a group of edges (e1, e2, e3). An edge is a set of vertexes. The two vertexes are named the edge en

differences between direct and indirect recursion

I =PR/12 Numbers of years .Interest rate up to 1yrs . 5.50 up to 5yrs . 6.50 More than 5 yrs . 6.75 design an algorithm based on the above information

First - Fit Method: -    The free list is traversed sequentially to search the 1st free block whose size is larger than or equal to the amount requested. Once the block is found it