예제 #1
0
파일: HoTSQueue.cs 프로젝트: Mexahoid/CSF
        public static int FindMax(HoTSQueue OldQueue)
        {
            int Max = int.MinValue;
            HoTSQueue NewQueue = new HoTSQueue();

            if (!OldQueue.QueueIsEmpty())
                do
                {
                    NewQueue.InQueue(OldQueue.OutQueue());
                    if (NewQueue.QueueTail.NodeQueueValue > Max)
                        Max = NewQueue.QueueTail.NodeQueueValue;
                }
                while (!OldQueue.QueueIsEmpty());
            return Max;
        }
예제 #2
0
파일: HoTSQueue.cs 프로젝트: Mexahoid/CSF
 public static int FindMaxCount(HoTSQueue OldQueue)
 {
     int Count = 0;
     HoTSQueue NewQueue = new HoTSQueue();
     int Max = FindMax(OldQueue);
     if (!OldQueue.QueueIsEmpty())
         do
         {
             NewQueue.InQueue(OldQueue.OutQueue());
             if (NewQueue.QueueTail.NodeQueueValue == Max)
                 Count++;
         }
         while (!OldQueue.QueueIsEmpty());
     return Count;
 }