3 ms·
I don't get it either. How did they suggest using an XML document to act as a priority queue? I actually would have found that highly amusing! My naive contrib
by WWLink 6y ago
I don't get it either. How did they suggest using an XML document to act as a priority queue? I actually would have found that highly amusing!
My naive contribution: A linked list with pointers to the tails of various priorities. The grabber just points to the head and pops things off the top as it goes.
- shaftway 6y ago> How did they suggest using an XML document to act as a priority queue? I actually would have found that highly amusing! I tried. It got tiring. Sometimes people would loop through all possible priorities plugging them into an XPath query and pop the first element of the highest priority that matched. Some would do two XPath queries, one across all nodes to get the max priority and a second to query the first element (ignoring the lack of a need to run the query a second time at all). Some would insist that XPath has some function that would let you select a node with an attribute that has the maximum numeric value. I'd have been fine with your solution.