diff options
author | Toby Vincent <tobyv13@gmail.com> | 2021-03-28 01:53:40 +0000 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2021-03-28 01:53:40 +0000 |
commit | b0981d54a1a599d11b2c78a5a734071e7cbf8abe (patch) | |
tree | 4fe32d1664b2c457f6250b5f2f2b726ec8de3b17 | |
parent | cc8a5639d2afd06850da02b467b61fdf38bb17de (diff) |
added more documentation and cleaned up code
-rwxr-xr-x | PriorityQueue.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/PriorityQueue.cs b/PriorityQueue.cs index 2a4b4f4..72663be 100755 --- a/PriorityQueue.cs +++ b/PriorityQueue.cs @@ -5,10 +5,11 @@ namespace PriorityQueue {
public class PriorityQueue<T, U> : Heap<T, U> where T : INode<U> where U : IComparable<U>
{
+ // workaround for due to inablitly to call MaxValue/MinValue on generics
static readonly U _maxValue = (U)typeof(U).GetField("MaxValue").GetValue(null);
static readonly U _minValue = (U)typeof(U).GetField("MinValue").GetValue(null);
-
public U LeastSignificant { get => IsMin ? _maxValue : _minValue; }
+
public int[] Location { get; set; }
// indexer - returns null if attempting to access outside heap
|