Exemple #1
0
        public static void FindMedian()
        {
            int    count  = numbers.Count;
            double median = 0;

            if (count % 2 == 0)
            {
                var firstMed  = numbers[count / 2];
                var secondMed = numbers[count / 2 - 1];
                median = (double)(firstMed + secondMed) / 2;
            }
            else
            {
                median = numbers.AsList()[(count - 1) / 2];
            }
            result.Add(median);
        }
Exemple #2
0
 public List <IEntity> GetAll()
 {
     return(data.AsList().ToList());
 }