mirror of
https://github.com/AlexMacocian/SystemExtensions.git
synced 2026-07-24 12:06:27 +00:00
fixed bug with treap
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user