Aktuell
parent
0d0d1f3f59
commit
57bd6f12e2
|
@ -1,17 +0,0 @@
|
|||
package DynamicTree;
|
||||
|
||||
public class DynamicTree <T extends Comparable <T>> {
|
||||
|
||||
public void add(T e) {
|
||||
if(root == null) {
|
||||
root = new TreeElement<T>(e);
|
||||
} else {
|
||||
if(e.compareTo(root.value) < 0 )
|
||||
root.left = new TreeElement <T> (e);
|
||||
|
||||
else
|
||||
root.right = new TreeElement <T>(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -15,7 +15,7 @@ public class Uebung1_Stack {
|
|||
for(int i = 0 ; i < eingabe.length(); i++) {
|
||||
ausdruck += eingabe.charAt(i);
|
||||
}
|
||||
StreamTokenizer st = new StreamTokenizer(ausdruck);
|
||||
// StreamTokenizer st = new StreamTokenizer(ausdruck);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,26 +12,26 @@ public class Uebung3_Queue implements Comparator <String>{
|
|||
statusQueue.offer("Bronze");
|
||||
statusQueue.offer("Silber");
|
||||
|
||||
Queue <String> ausgabe = sortiereNachPrio(statusQueue);
|
||||
// Queue <String> ausgabe = sortiereNachPrio(statusQueue);
|
||||
|
||||
for (String string : ausgabe) {
|
||||
System.out.println(string);
|
||||
// for (String string : ausgabe) {
|
||||
// System.out.println(string);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Queue<String> sortiereNachPrio(Queue <String> status){
|
||||
|
||||
Queue <String> queue = new PriorityQueue<String>(status);
|
||||
|
||||
|
||||
Iterator <String> it = queue.iterator();
|
||||
|
||||
while(it.hasNext()) {
|
||||
// public Queue<String> sortiereNachPrio(Queue <String> status){
|
||||
//
|
||||
// Queue <String> queue = new PriorityQueue<String>(status);
|
||||
//
|
||||
//
|
||||
// Iterator <String> it = queue.iterator();
|
||||
//
|
||||
// while(it.hasNext()) {
|
||||
//
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int compare(String o1, String o2) {
|
||||
|
|
|
@ -13,7 +13,7 @@ public class Sortierung_Aufgabe {
|
|||
zahlen[i] = random;
|
||||
}
|
||||
// Arrays.sort(zahlen);
|
||||
sortieren(zahlen);
|
||||
//sortieren(zahlen);
|
||||
System.out.println(Arrays.toString(zahlen));
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue