Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我刚刚完成了一个复杂的工作分配应用程序的编码,其中很多工作都是使用优先级队列完成的。然而,当我部署时,我发现 Web 服务器运行的是 PHP 5.2。
是否有 PHP<5.3 的实现可以作为 SPLPriorityQueue 的替代品?
我会认为使用 SPLMaxHeap 和每个项目的包装器构建一个非常简单?
C。
我不知道任何具有相同界面的东西。
但是,我想指出,如果您不需要堆实现的性能特征(小型数据集可能不需要),那么使用常规 php 数组编写自己的工作不会太多。