From 7087ab2f048ac5f566990c74f00a5e72ba5096d1 Mon Sep 17 00:00:00 2001 From: Alex Macocian Date: Mon, 22 Apr 2019 15:06:04 +0200 Subject: [PATCH] fixed bug with treap --- SystemExtensions/Collections/Treap.cs | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/SystemExtensions/Collections/Treap.cs b/SystemExtensions/Collections/Treap.cs index 1ea78fc..e59a388 100644 --- a/SystemExtensions/Collections/Treap.cs +++ b/SystemExtensions/Collections/Treap.cs @@ -13,6 +13,19 @@ namespace SystemExtensions.Collections public class Treap { #region Fields + private class Item + { + public T Key; + public int Priority; + public Item Left, Right; + public Item(T key, int priority) + { + Key = key; + Priority = priority; + Left = null; + Right = null; + } + } private Random randomGen; private Item root; private Comparison comparator; @@ -226,18 +239,4 @@ namespace SystemExtensions.Collections } #endregion } - - internal class Item - { - public T Key; - public int Priority; - public Item Left, Right; - public Item(T key, int priority) - { - Key = key; - Priority = priority; - Left = null; - Right = null; - } - } }