|
From: Samuel K. <ib...@ly...> - 2003-02-11 02:22:51
|
A bit of a strange question here. I want to make a queue that I can search through for a flag and if the flag is set to one condition perform operation A. If it is set to another condition do operation B, etc, etc. I thought an effiecent way to do this would be to sort the items before they go onto the queue, but to do this I would have to have a function that can stick a queue element in between other elements. With arrays this is terribly wastiful of time. Linked lists are better but if I want to stick an element right in the middle, I still have to follow the links all the way down the list. I thought of dynamically allocating an array of pointers that point to a datatype T (template) but I would still have to worry about a bunch of assignment operations. The last option I can think of is my original flag with an array, but I really wish I could come up with a better way to sort the queue. Your help is appreciated. _____________________________________________________________ Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year. http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus |