MyProg.java:44:错误:类型不匹配:无法从 void 转换为 SearchTree
SearchTree nTree = nTree.insert(value);
^^^^^^^^^^^^^^^^^^^
SearchTree.java:18:错误:类型不匹配:无法从 void 转换为 int[] value = Arrays.sort(value);
package ab12;
public class MyProg {
public static void main(String[] args) {
QueueScheduler q = new QueueScheduler();
int c = 0;
for (int i = 0; i < 10; i++) {
q.dynQueue[c].put(i);
if (c == 2) {
c = -1;
}
c++;
}
Out.println("1. Random");
Out.println(q.getRandom());
Out.println(q.getRandom());
Out.println(q.getRandom());
Out.println("2. Priority");
Out.println(q.getPriority());
Out.println(q.getPriority());
Out.println("3. RoundRobin");
Out.println(q.getRoundRobin());
Set set = new Set();
Set other = new Set();
String e = "Hallo";
String e2 = "H.";
String e3 = "red";
String e4 = "blue";
String e5 = "light";
set.add(e);
set.add(e2);
set.add(e3);
set.remove(e);
other.add(e2);
other.add(e3);
other.add(e4);
other.add(e5);
set.union(other);
set.difference(other);
set.isSubsetOf(other);
int value [] = new int[]{1, 3, 5, 7, 9, 13, 18, 19, 21};
SearchTree nTree = nTree.insert(value);
int s = nTree.sum();
int num = nTree.numberOfLeafs();
}
}