开发者

PHP Priority Queue Implementation

I just finished coding a complex job assignment application where a lot of the work was done开发者_StackOverflow社区 using priority queues. When I deployed, however, I discovered the web server ran PHP 5.2.

Has there been an implementation for PHP<5.3 that can server as a drop-in replacement for SPLPriorityQueue?


I don't know of anything that has the same interface.

But, I'd like to point out that if you don't need the performance characteristics of the heap implementation(small data sets probably don't), it wouldn't be much work to write your own using a regular php array.


I would have thought it would be quite simple to build one using SPLMaxHeap and a wrapper for each item?

C.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜