How could I improve this C# randomising method?

前端 未结 7 2185
南方客
南方客 2021-02-10 20:30

I think I\'ve settled on this as the most simple and unit-testable method for randomising a list, but would be interested to hear of any improvements.

public sta         


        
7条回答
  •  花落未央
    2021-02-10 20:43

    No stats to support this but it would seem better if your return value starts as an array of the same length as the list and then you insert values directly into a randomly generated index.

提交回复
热议问题