Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

Write an algorithm for Poping the Topmost element of queue using Singly Linked List in dfs.

  Shared By: Reginheraht Fischer    Date: Nov 10    Category: C++ Programming    Views: 1199

Answer:

PROCEDURE POP_QUEUE(TOP)
[Where top of the queue has been caught in pointer ‘TOP’]

1. [Removing the top node of queue]

P <-- T
TOP <-- LINK (TOP)
Call REMOVE NODE(P)
return (TOP).

2. [FINISH]
return.

Share: 
 


Related Topics:

Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: