Why is random.shuffle so much slower than using sorted function?

后端 未结 0 1954
别跟我提以往
别跟我提以往 2020-11-28 08:59

When using pythons random.shuffle function, I noticed it went significantly faster to use sorted(l, key=lambda _: random.random()) than rando

相关标签:
回答
  • 消灭零回复
提交回复
热议问题