3

大佬们, PHP 除了遍历以外,怎么用算法比较快的输出符合一个已经排序好的符合一个范...

 3 years ago
source link: https://www.v2ex.com/t/802310
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  PHP

大佬们, PHP 除了遍历以外,怎么用算法比较快的输出符合一个已经排序好的符合一个范围内的数组

  zhengfan2016 · 3 小时 41 分钟前 · 326 次点击

如题,萌新全干实习生。有一个查询功能,可以选择筛选一个符合从(m,n)范围的数据。
然后这个数据是需要对数据库取出的几万条数据进行一个实时遍历运算,然后再排序,最后需要筛一个符合( m,n )的范围。

萌新目前想到的就是用循环 二分法来找,不知道 v2 的大佬们有没有更好的方案


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK