コード例 #1
0
ファイル: Players.cs プロジェクト: finalfantasyfan87/hw2
        public int findMinWeight()
        {
            int        smallestWeight = Int32.MaxValue;
            SeLinkList lightest       = null;
            SeLinkList current        = head;

            while (current != null)
            {
                if (current.GetWeight() < smallestWeight)
                {
                    smallestWeight = current.GetWeight();
                    lightest       = current;
                }
            }
            Console.WriteLine("MIN: " + lightest.GetWeight());
            return(lightest.GetWeight());
        }
コード例 #2
0
ファイル: Players.cs プロジェクト: finalfantasyfan87/hw2
        public int findMaxWeight()
        {
            int        largerWeight = Int32.MinValue;
            SeLinkList heaviest     = null;
            SeLinkList current      = head;

            while (current != null)
            {
                if (current.GetWeight() > largerWeight)
                {
                    largerWeight = current.GetWeight();
                    heaviest     = current;
                }
            }
            Console.WriteLine("MAX:: " + heaviest.GetWeight());
            return(heaviest.GetWeight());
        }