public static Dictionary <string, float> PopulateDict(int size, float maxNumber, bool randomData = false) { Dictionary <string, float> ts = new Dictionary <string, float>(); if (randomData) { RandomFloat random = new RandomFloat(); for (int i = 0; i < size; i++) { ts.Add(i.ToString(), random.NextFloat(0, maxNumber)); } } else { for (int i = 0; i < size; i++) { ts.Add(i.ToString(), i + 1); } } return(ts); }
public static Queue <float> PopulateQueue(int size, float maxNumber, bool randomData = false) { Queue <float> ts = new Queue <float>(); if (randomData) { RandomFloat random = new RandomFloat(); for (int i = 0; i < size; i++) { ts.Enqueue(random.NextFloat(0, maxNumber)); } } else { for (int i = 0; i < size; i++) { ts.Enqueue(i + 1 + (float)i / size); } } return(ts); }
public static List <float> PopulateList(int size, float maxNumber, bool randomData = false) { List <float> ts = new List <float>(); if (randomData) { RandomFloat random = new RandomFloat(); for (int i = 0; i < size; i++) { ts.Add(random.NextFloat(0, maxNumber)); } } else { for (int i = 0; i < size; i++) { ts.Add(i + 1 + (float)i / size); } } return(ts); }
public static float[] PopulateArray(int size, float maxNumber, bool randomData = false) { float[] ts = new float[size]; if (randomData) { RandomFloat random = new RandomFloat(); for (int i = 0; i < ts.Length; i++) { ts[i] = random.NextFloat(0, maxNumber); } } else { for (int i = 0; i < ts.Length; i++) { ts[i] = i + 1 + (float)i / ts.Length; } } return(ts); }
public static Stack <float> PopulateStack(int size, float maxNumber, bool randomData = false) { Stack <float> ts = new Stack <float>(); if (randomData) { RandomFloat random = new RandomFloat(); for (int i = 0; i < size; i++) { ts.Push(random.NextFloat(0, maxNumber)); } } else { for (int i = 0; i < size; i++) { ts.Push(i + 1 + (float)i / size); } } return(ts); }