SS 2025
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import java.util.TreeSet;
|
||||
|
||||
public class BaumSet {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
int n = 17;
|
||||
|
||||
TreeSet<Integer> baumSet = new TreeSet<>();
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
baumSet.add(i * 2);
|
||||
}
|
||||
|
||||
for (Integer baum : baumSet) {
|
||||
System.out.println(baum);
|
||||
}
|
||||
|
||||
int c = baumSet.higher(n);
|
||||
System.out.println(c);
|
||||
|
||||
int d = baumSet.pollFirst();
|
||||
System.out.println(d);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user