Mercurial > hg > Database > jungle-sharp
diff Main/jungle-main/data/treemap/EmptyNode.cs @ 35:f2ea780b3e80
fix
author | Kazuma Takeda |
---|---|
date | Wed, 22 Feb 2017 16:30:19 +0900 |
parents | 1f99e150f336 |
children |
line wrap: on
line diff
--- a/Main/jungle-main/data/treemap/EmptyNode.cs Tue Feb 07 20:50:50 2017 +0900 +++ b/Main/jungle-main/data/treemap/EmptyNode.cs Wed Feb 22 16:30:19 2017 +0900 @@ -1,68 +1,78 @@ -using UnityEngine; -using System.Collections; -using System.Collections.Generic; -using System; +using System.Collections.Generic; -public class EmptyNode<K,V> : TreeMapNode<K,V>{ +public class EmptyNode<K, V> : TreeMapNode<K, V> +{ //static V values; // Use this for initialization - public EmptyNode () - : base (default(K),default(V)) + public EmptyNode() + : base(default(K), default(V)) { } - public EmptyNode (K key) - : base (key,default(V)) + public EmptyNode(K key) + : base(key, default(V)) { } - public override TreeMapNode<K,V> lefts(){ - return new EmptyNode<K,V>(); + public override TreeMapNode<K, V> lefts() + { + return new EmptyNode<K, V>(); } - public override TreeMapNode<K,V> rights(){ - return new EmptyNode<K,V>(); + public override TreeMapNode<K, V> rights() + { + return new EmptyNode<K, V>(); } - public override bool isNotEmpty(){ + public override bool isNotEmpty() + { return false; } - public override TreeMapNode<K,V> createNode(K key,V value,TreeMapNode<K,V> left, TreeMapNode<K,V> right){ - return new RedNode<K,V> (key, value, new EmptyNode<K,V> (), new EmptyNode<K,V> ()); + public override TreeMapNode<K, V> createNode(K key, V value, TreeMapNode<K, V> left, TreeMapNode<K, V> right) + { + return new RedNode<K, V>(key, value, new EmptyNode<K, V>(), new EmptyNode<K, V>()); } - public TreeMapNode<K,V> put(K k,V value){ - return new RedNode<K, V> (k, value, new EmptyNode<K,V> (), new EmptyNode<K,V> ()); + public TreeMapNode<K, V> put(K k, V value) + { + return new RedNode<K, V>(k, value, new EmptyNode<K, V>(), new EmptyNode<K, V>()); } //I don't know only Comparator method. - public override rebuildNode<K, V> replaceNode(TreeMapNode<K, V> parent, Comparer<K> ctr) { // not use method - return new rebuildNode<K,V>(false, this); + public override rebuildNode<K, V> replaceNode(TreeMapNode<K, V> parent, Comparer<K> ctr) + { // not use method + return new rebuildNode<K, V>(false, this); } - public override rebuildNode<K,V> deleteNode(){ - return new rebuildNode<K, V> (false, this); + public override rebuildNode<K, V> deleteNode() + { + return new rebuildNode<K, V>(false, this); } - - public override TreeMapNode<K,V> insBalance(){ + + public override TreeMapNode<K, V> insBalance() + { return insBalance(); } - public override Rotate checkRotate(Rotate side){ + public override Rotate checkRotate(Rotate side) + { return Rotate.N; } - public override bool isRed(){ + public override bool isRed() + { return false; } - public override int checkDepth(int count, int minCount) { // test method - if (count < minCount || minCount == 0) { + public override int checkDepth(int count, int minCount) + { // test method + if (count < minCount || minCount == 0) + { minCount = count; } - //c# is there assert?? - //Assert.assertTrue(count <= 2 * minCount); + //c# is there assert?? + //Assert.assertTrue(count <= 2 * minCount); return minCount; }