以下代码为c#语言,变为其他语言也很容易。
说明:
1.该算法复杂度为线性,且无需对权重排序。是我想到的最高效的了。
private static List<object> WeightKey_ = new List<object>();
private static List<float> WeightValueFloat_ = new List<float>();
private static List<int> WeightValueInt_ = new List<int>();
按权重随机
最新推荐文章于 2023-02-15 08:32:27 发布