Thread: Priority Queue

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    6

    Unhappy Priority Queue

    Hi, how can i create a priority queue in C that compares the values of an entry and displays the entry with the lowest value first? Please help me!!!!!!!

    email me if u have any help

    Thanx

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Simple, just take input, and add it to a linked list so that the lowest entry is always on top. (Thus, if you call something like a 'pop' function, it'll give you the lowest one.)

    I'd personally use a double linked list, because they're so much easier for this sort of thing than a single linked list.

    Quzah.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with FIFO QUEUE
    By jackfraust in forum C++ Programming
    Replies: 23
    Last Post: 04-03-2009, 08:17 AM
  2. Fixing my program
    By Mcwaffle in forum C Programming
    Replies: 5
    Last Post: 11-05-2008, 03:55 AM
  3. Priority Queue Help
    By cjwenigma in forum C++ Programming
    Replies: 6
    Last Post: 11-15-2007, 12:48 AM
  4. help with queues
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 05-21-2002, 09:09 PM
  5. help with queues
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 05-21-2002, 11:39 AM