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

#title., Ask quapplication of data structure estion #Minimum 100 words acce...

Ask quapplication of data structure estion #Minimum 100 words accepted#

Encryption the plain-text using the round keys, Encryption the plain-text u...

Encryption the plain-text using the round keys: 1. (Key schedule) Implement an algorithm that will take a 128 bit key and generate the round keys for the AES encryption/decryp

Total weight of minimum spanning tree, a) Run your program for α = 0.05, 0...

a) Run your program for α = 0.05, 0.5, and 0.95. You can use n = 30, and W = 10. What is impact of increasing value of α on connectivity of G'? To answer this question, for each v

Define strictly binary tree, Define Strictly Binary Tree Strictly Bina...

Define Strictly Binary Tree Strictly Binary Tree: - If each non leaf node in binary tree has non empty left and right sub-trees , then the tree is known as a strictly binary t

Applications of binary trees, In computer programming, Trees are utilized ...

In computer programming, Trees are utilized enormously. These can be utilized for developing database search times (binary search trees, AVL trees, 2-3 trees, red-black trees), Gam

Explain insertion sort, Q. Explain the insertion sort with a proper algorit...

Q. Explain the insertion sort with a proper algorithm. What is the complication of insertion sort in the worst case?

Mapping constain, one to many one to one many to many many to one

one to many one to one many to many many to one

Explain memory allocation strategies, Memory Allocation Strategies If i...

Memory Allocation Strategies If it is not desirable to move blocks of due storage from one area of memory to another, it must be possible to relocate memory blocks that have be

Recursion, i need help in java recursion assignment.

i need help in java recursion assignment.

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