Follow

Translate

Thursday, March 17, 2016

One Way List Representation of a Priority Queue

One Way List Representation of a Priority Queue: 

One way to maintain a priority queue in memory is by means of a one-way list, as follows:

(a)  Each node in the list will contain three items of information: an information field INFo, a priority number PRN and a link number LINK.

(b)  A node X preceds a node Y in the list (1) when X has higher priority than Y or (2) when both have the same priority  but X was added to the list before Y. This means that the order in the one-way list corresponds to the order of the priority queue.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Related Posts:

  • FACTORIAL(FACT, N) Procedure A: FACTORIAL(FACT, N) This procedure calculate N! and returns the value in the variable FACT. 1.  If N = 0, then:Set FACT : = 1, and return. 2.  Set FACT : = 1. [Initializes FACT for loo.] 3.  Re… Read More
  • What is Recursion? Recursion:   A recursive must have two proprties (a)  There must be certain criteria, called base criteria, for which the procedure does not call itself. (b)  Each time the procedure does call itself (di… Read More
  • FIBONACCI(FIB, N) FIBONACCI(FIB, N) This procedure calculates FN and returns the value in the first parameter FIB. 1.  If N = 0 or N = 1, then : Set FIB : = N, and return. 2. Call FIBONACCI(FIBA, N-2). 3. Call FIBONACCI(FIBB, N-1… Read More
  • Traversing Binary Tree Traversing Binary Tree: There are three standard ways of traversing a binary tree T with root R. These three algorithms, called preorder, inorder and postorder. Preorder:         &n… Read More
  • Example Of Factorial Function Example Of Factorial Function:    n! = 1.2.3...............(n-2)(n-1)n 0! = 1             1! = 1         2! = 1.2 = 2     &… Read More

0 comments:

Post a Comment