Follow

Translate

Wednesday, March 16, 2016

QDELETE(QUEUE, N, FRONT, REAR, ITEM)


1.    [Queue already filled?]
          If FRONT = NULL and REAR = N, or if FRONT = REAR + 1, then:
              Write: UNDERFLOW, and Return.

2.  Set ITEM : = QUEUE[FRONT]

3.             [Find new value of REAR.]

                         If  FRONT : = REAR, then:  [ Queue has only one element to start]
                       If  FRONT : = NULL and REAR : = NULL
                       
Else if FRONT = N, then:

Set FRONT : = 1.

Else :
              Set REAR : = REAR + 1 .

[End of  If structure]

4. Return
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

0 comments:

Post a Comment