gpt4 book ai didi

random - "Random Article"wikipedia.com 上的功能

转载 作者:行者123 更新时间:2023-12-02 04:49:21 24 4
gpt4 key购买 nike

我想知道维基百科使用什么算法和编程语言来随机选择要显示的文章。

我也想知道它是如何工作得这么快的?

最佳答案

Here's 相关信息。

Every article is assigned a random number between 0 and 1 when it is created (these are indexed in SQL, which is what makes selection fast). When you click random article it generates a target random number and then returns the article whose recorded random number is closest to this target.

如果有兴趣可以阅读实际代码here .

关于random - "Random Article"wikipedia.com 上的功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1136775/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com