Mercurial > hg > Database > jungle-sharp
changeset 3:224f0f8b4f40
List delete test write.
author | Kazuma |
---|---|
date | Mon, 04 Jul 2016 01:54:44 +0900 |
parents | a3af05a061b4 |
children | 79da77797f7e |
files | src/main/csharp/jp.ac.u-ryukyu.ie.cr/jungle/data/treemap/TreeMap.cs src/main/csharp/jp.ac.u-ryukyu.ie.cr/jungle/data/treemap/TreeMapNode.cs |
diffstat | 2 files changed, 3 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/csharp/jp.ac.u-ryukyu.ie.cr/jungle/data/treemap/TreeMap.cs Fri Jul 01 19:28:57 2016 +0900 +++ b/src/main/csharp/jp.ac.u-ryukyu.ie.cr/jungle/data/treemap/TreeMap.cs Mon Jul 04 01:54:44 2016 +0900 @@ -19,7 +19,6 @@ public TreeMap(TreeMapNode<K, V> root) { this.root = root; - //this.comparator = comparator; } public TreeMap(TreeMapNode<K, V> root, Comparer<K> comparator) {
--- a/src/main/csharp/jp.ac.u-ryukyu.ie.cr/jungle/data/treemap/TreeMapNode.cs Fri Jul 01 19:28:57 2016 +0900 +++ b/src/main/csharp/jp.ac.u-ryukyu.ie.cr/jungle/data/treemap/TreeMapNode.cs Mon Jul 04 01:54:44 2016 +0900 @@ -9,6 +9,7 @@ protected K key = default(K); protected V value = default(V); + public TreeMapNode<K,V> right; public TreeMapNode<K,V> left; @@ -35,12 +36,10 @@ public int compare(K compareKey, Comparer<K> ctr) { - int val = (int) ctr.Compare (compareKey, this.getKey ()); - return val; + return ctr.Compare (compareKey, this.getKey ()); } - public V get (K key, Comparer<K> ctr) - { + public V get (K key, Comparer<K> ctr){ TreeMapNode<K,V> cur = this; while (cur.isNotEmpty ()) { // getでEmpty nodeを返している ? compareでKeyが0になっている int result = cur.compare (key, ctr); @@ -71,7 +70,6 @@ return value; } - // may be to use Comparer?? public TreeMapNode<K,V> put (K k, V v,Comparer<K> ctr) { if (!isNotEmpty ()) {