comparison src/test/csharp/jp.ac.u-ryukyu.ie.cr/data/treemap/TreeMapDelete.cs @ 1:5c58219da97e

fix code TreeMap
author Kazuma
date Fri, 01 Jul 2016 11:41:41 +0900
parents dec15de2c6ff
children a3af05a061b4
comparison
equal deleted inserted replaced
0:dec15de2c6ff 1:5c58219da97e
4 public class TreeMapDelete : MonoBehaviour { 4 public class TreeMapDelete : MonoBehaviour {
5 5
6 // Use this for initialization 6 // Use this for initialization
7 void Start () { 7 void Start () {
8 TreeMap<int,int> map = new TreeMap<int, int> (); 8 TreeMap<int,int> map = new TreeMap<int, int> ();
9 for (int count = 1; count < 5; count++) { 9 for (int count = 1; count < 6; count++) {
10 Debug.Log (count);
10 map = map.put (count, count); 11 map = map.put (count, count);
12 int val = map.get(count);
13 Debug.Log ("value : " + val);
11 map.checkDepth (); 14 map.checkDepth ();
12 } 15 }
13 16
14 ArrayList list = new ArrayList (); 17 // ただ消すための数字をここに入れているだけ
18 List<int> list = new List<int>(5);
15 for (int i = 1; i < 5; i++) { 19 for (int i = 1; i < 5; i++) {
16 list.Add (i); 20 list.Add (i);
17 } 21 }
18 22
19 for (int i = 1; i < 5; i++) {
20 int ran = Random.Range (1, 6);
21 object obj = list [i];
22 list [i] = list [ran];
23 list [ran] = obj;
24 }
25
26 foreach(int num in list){ 23 foreach(int num in list){
27 Debug.Log (num);
28 map = map.delete(num); 24 map = map.delete(num);
29 map.checkDepth(); 25 map.checkDepth();
30 } 26 }
31 Debug.Log ("end"); 27 Debug.Log ("end");
32 } 28 }