fixed bug with treap

This commit is contained in:
Alex Macocian
2019-04-22 15:06:04 +02:00
parent 95f2ab709f
commit 7087ab2f04
+13 -14
View File
@@ -13,6 +13,19 @@ namespace SystemExtensions.Collections
public class Treap<T>
{
#region Fields
private class Item<T>
{
public T Key;
public int Priority;
public Item<T> Left, Right;
public Item(T key, int priority)
{
Key = key;
Priority = priority;
Left = null;
Right = null;
}
}
private Random randomGen;
private Item<T> root;
private Comparison<T> comparator;
@@ -226,18 +239,4 @@ namespace SystemExtensions.Collections
}
#endregion
}
internal class Item<T>
{
public T Key;
public int Priority;
public Item<T> Left, Right;
public Item(T key, int priority)
{
Key = key;
Priority = priority;
Left = null;
Right = null;
}
}
}