예제 #1
0
 /// <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))
 {
 }
예제 #2
0
 /// <summary>
 /// Use the default comparer for the K type.
 /// </summary>
 public KeyComparer()
 {
     comparer = Comparers.DefaultComparer <K>();
 }
예제 #3
0
 /// <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))
 {
 }
예제 #4
0
 /// <summary>
 /// Creates a new PriorityQueue. The P must implement IComparable&lt;P&gt;
 /// 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&lt;TKey&gt;.</exception>
 public PriorityQueue() :
     this(Comparers.DefaultComparer <T>())
 {
 }
예제 #5
0
 public SplayTree(IEnumerable <T> collection) :
     this(collection, Comparers.DefaultComparer <T>())
 {
 }
예제 #6
0
 /// <summary>
 /// Creates a new PriorityQueue. The P must implement IComparable&lt;P&gt;
 /// 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>())
 {
 }
예제 #7
0
 public SplayTree() :
     this(Comparers.DefaultComparer <T>())
 {
 }
예제 #8
0
 /// <summary>
 /// Creates a new PriorityQueue. The P must implement IComparable&lt;P&gt;
 /// 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>())
 {
 }
예제 #9
0
 /// <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))
 {
 }
예제 #10
0
 /// <summary>
 /// Creates a new PriorityQueue. The P must implement IComparable&lt;P&gt;
 /// 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&lt;TKey&gt;.</exception>
 public PriorityQueueDictionary() :
     this(Comparers.DefaultComparer <P>())
 {
 }
예제 #11
0
 /// <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))
 {
 }