예제 #1
0
        public void InsertKey(T key)
        {
            if (HeapSize == HeapArray.Length)
            {
                T[] newHeap = new T[HeapArray.Length * 2];
                HeapArray.CopyTo(newHeap, 0);
                HeapArray = newHeap;
            }

            HeapArray[HeapSize] = key;
            FixUp(HeapSize++);
        }