Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uwm.edu!linac!att!pacbell.com!ames!haven!adm!news From: TAIBI91%SNYNEWVM.BITNET@uga.cc.uga.edu (S. Taibi) Newsgroups: comp.lang.pascal Subject: Priority queue Message-ID: <26282@adm.brl.mil> Date: 15 Mar 91 14:15:16 GMT Sender: news@adm.brl.mil Lines: 18 I don't have the code handy, but here is a suggestion: Make the node of the linked list like this: NODE = RECORD PRIORITY : INTEGER; ELEMENT : ; { whatever data is being listed } NEXT : @NODE; END; Insert to the list by simply appending to the end of the list, and worry about checking priority only when removing a node from the list. This is probably the simplest way to implement a prority queue, but it is not the fastest. I hope this helps. S. Taibi