Deletion algorithm for dequeue, Data Structure & Algorithms

Assignment Help:

Deletion Algorithm for dequeue

Step 1: [check for underflow]
  If front = 0 and rear = 0
  Output "underflow" and return

Step 2: [delete element at front end]
  If front > 0
  Value = q [front]
  Return [value]

Step 3: [check queue for empty]
  If front = rear
  Front = rear = 0
  Else
  Front = front +1

Step 4: [delete element at the rear end]
  If rear > 0
  Value = Q [rear]
  Return (rear)

Step 5: [check queue for empty]
  If front = rear
  Front = rear = 0
  Else
  Rear = rear - 1

Step 6:  Return 


Related Discussions:- Deletion algorithm for dequeue

Sparse matrix, memory address of any element of lower left triangular spars...

memory address of any element of lower left triangular sparse matrix

Pipeling, Asktypes of pipelining question #Minimum 100 words accepted#

Asktypes of pipelining question #Minimum 100 words accepted#

Sparse matrix, How sparse matrix stored in the memory of a computer?

How sparse matrix stored in the memory of a computer?

Recursion, differences between direct and indirect recursion

differences between direct and indirect recursion

State about the pre- and post conditions, State about the pre- and post con...

State about the pre- and post conditions Programmers can easily document other pre- and post conditions and class invariants, though, and insert code to check most value preco

Implementation of a binary tree, Like general tree, binary trees are implem...

Like general tree, binary trees are implemented through linked lists. A typical node in a Binary tree has a structure as follows struct NODE { struct NODE *leftchild; i

Construction of a binary tree , Q. Construct a binary tree whose nodes in i...

Q. Construct a binary tree whose nodes in inorder and preorder are written as follows: Inorder : 10, 15, 17, 18, 20, 25, 30, 35, 38, 40, 50 Preorder: 20, 15, 10

Algorithms, 2. Write a note on i) devising ii) validating and...

2. Write a note on i) devising ii) validating and iii) testing of algorithms.

Threaded binary tree, i need the full concept of it... please can anyone pr...

i need the full concept of it... please can anyone provide

Explain about franklin algorithm, Explain about Franklin Algorithm We m...

Explain about Franklin Algorithm We mentioned how the number of possible comparisons of polygons grows as the square of the number of polygons in the scene. Many of the hidden-

5/11/2013 1:28:05 AM

Thanks for suggesting me this answer, appreciate your knowledge.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd