Пример #1
0
        private object[] _array;          // TODO: Use Guava's MinMaxPriorityQueue to avoid having this array

        public DefaultComparatorTopTable(IComparer <T> comparator, int totalCount)
        {
            this._comparator = comparator;
            if (totalCount <= 0)
            {
                throw new System.ArgumentException("Top table size must be greater than 0");
            }
            this._totalCount = totalCount;

            _heap = new PriorityQueue <T>(Math.Min(totalCount, 1024), comparator.reversed());
        }