/// <summary> /// Creates a new PriorityQueue. The passed delegate will be used to compare /// item priorities as they are inserted into the queue. /// </summary> /// <param name="comparison">A delegate to a method that will be used to compare priorities.</param> public PriorityQueue(Comparison <T> comparison) : this(Comparers.ComparerFromComparison(comparison)) { }
/// <summary> /// Use the default comparer for the K type. /// </summary> public KeyComparer() { comparer = Comparers.DefaultComparer <K>(); }
/// <summary> /// Creates a new PriorityQueue. The passed delegate will be used to compare /// item priorities as they are inserted into the queue. /// The PriorityQueue is initialized with all the items in the given sequence. /// </summary> /// <param name="sequence">A sequence with items to be placed into the PriorityQueue.</param> /// <param name="comparison">A delegate to a method that will be used to compare priorities.</param> public PriorityQueue(IEnumerable <T> sequence, Comparison <T> comparison) : this(sequence, Comparers.ComparerFromComparison(comparison)) { }
/// <summary> /// Creates a new PriorityQueue. The P must implement IComparable<P> /// or IComparable. The CompareTo method of this interface will be used to /// prioritise items as they are inserted into the queue. /// </summary> /// <exception cref="InvalidOperationException">T does not implement IComparable<TKey>.</exception> public PriorityQueue() : this(Comparers.DefaultComparer <T>()) { }
public SplayTree(IEnumerable <T> collection) : this(collection, Comparers.DefaultComparer <T>()) { }
/// <summary> /// Creates a new PriorityQueue. The P must implement IComparable<P> /// or IComparable. /// The CompareTo method of this interface will be used to compare item priorities as /// they are inserted into the queue. /// The PriorityQueue is initialized with all the items in the given sequence. /// </summary> /// <param name="sequence">A sequence with items to be placed into the PriorityQueue.</param> public PriorityQueue(IEnumerable <T> sequence) : this(sequence, Comparers.DefaultComparer <T>()) { }
public SplayTree() : this(Comparers.DefaultComparer <T>()) { }
/// <summary> /// Creates a new PriorityQueue. The P must implement IComparable<P> /// or IComparable. /// The CompareTo method of this interface will be used to compare item priorities as /// they are inserted into the queue. /// The PriorityQueue is initialized with all the items in the given collection. /// </summary> /// <param name="collection">A collection with items to be placed into the PriorityQueue.</param> public PriorityQueueDictionary(IEnumerable <T> collection) : this(collection, Comparers.DefaultComparer <P>()) { }
/// <summary> /// Creates a new PriorityQueue. The passed delegate will be used to compare /// item priorities as they are inserted into the queue. /// </summary> /// <param name="comparison">A delegate to a method that will be used to compare priorities.</param> public PriorityQueueDictionary(Comparison <P> comparison) : this(Comparers.ComparerFromComparison(comparison)) { }
/// <summary> /// Creates a new PriorityQueue. The P must implement IComparable<P> /// or IComparable. The CompareTo method of this interface will be used to /// prioritise items as they are inserted into the queue. /// </summary> /// <exception cref="InvalidOperationException">T does not implement IComparable<TKey>.</exception> public PriorityQueueDictionary() : this(Comparers.DefaultComparer <P>()) { }
/// <summary> /// Creates a new PriorityQueue. The passed delegate will be used to compare item priorities as they are inserted into the queue. /// The PriorityQueue is initialized with all the priorities and items in Pairs in the given collection. /// </summary> /// <param name="collection"></param> /// <param name="comparison">A delegate to a method that will be used to compare priorities.</param> public PriorityQueueDictionary(IEnumerable <Pair <P, T> > collection, Comparison <P> comparison) : this(collection, Comparers.ComparerFromComparison(comparison)) { }