예제 #1
0
        public SimpleTree createSimpleTree()
        {
            List <Int32> Data = LoadInteger();
            SimpleTree   s    = new SimpleTree();

            foreach (Int32 value in Data)
            {
                s.Add(value);
            }
            return(s);
        }
예제 #2
0
        // KAA: Schlechte Benennung von Methoden - Coderedundanz!!
        public double GetAverageInteger()
        {
            SimpleTree    s   = createSimpleTree();
            List <double> l   = s.printall();
            double        sum = 0;

            // KAA: Berechnung des Durchschnitts nicht effizient
            foreach (double value in l)
            {
                sum += value;
            }
            return(sum / l.Count);
        }