示例#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;
 }