Пример #1
0
        private ListRandom GetListRandom(int countNodes)
        {
            var list = new ListRandom();

            for (int i = 0; i < countNodes; i++)
            {
                list.AddWithoutRandom(i.ToString());
            }

            list.ForEachStoppable((ListNode node, ref bool stop) =>
            {
                node.Random = list.Get(_random.Next(0, list.Count - 1));
            });

            return(list);
        }