summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2021-03-28 01:53:40 +0000
committerToby Vincent <tobyv13@gmail.com>2021-03-28 01:53:40 +0000
commitb0981d54a1a599d11b2c78a5a734071e7cbf8abe (patch)
tree4fe32d1664b2c457f6250b5f2f2b726ec8de3b17
parentcc8a5639d2afd06850da02b467b61fdf38bb17de (diff)
added more documentation and cleaned up code
-rwxr-xr-xPriorityQueue.cs3
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