Du befindest dich hier: FSI Informatik » Prüfungsfragen und Altklausuren » Prüfungen im Bachelor-Studium (1. - 5. Semester) » aud » Forendiskussionen, bei Fragen bitte:   (Übersicht)

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
pruefungen:bachelor:aud:loesungws18 [26.06.2019 14:18] TOKAMAKpruefungen:bachelor:aud:loesungws18 [19.07.2019 12:42] (aktuell) – Formatierung ADTs dom
Zeile 163: Zeile 163:
     // Schaue, ob in sptree schon eine Adjazenzliste angelegt wurde     // Schaue, ob in sptree schon eine Adjazenzliste angelegt wurde
     // (eigentlich ist das ein Set, das ist aber nicht relevent)     // (eigentlich ist das ein Set, das ist aber nicht relevent)
-    if (!sptree.contains(v)) sptree.put(v, new HashSet<>()); +    if (!sptree.containsKey(v))
-    +     sptree.put(v, new HashSet<>()); 
 +    }
     // Betrachte alle Nachbarn im Graphen     // Betrachte alle Nachbarn im Graphen
     for (T w : graph.get(v)) {     for (T w : graph.get(v)) {
         // Überprüfe, ob Nachbar schon besucht wurde         // Überprüfe, ob Nachbar schon besucht wurde
-        if (!nums.contains(w) {+        if (!nums.containsKey(w) {
             sptree.get(v).add(w); // Füge Knoten zum Spannbaum hinzu             sptree.get(v).add(w); // Füge Knoten zum Spannbaum hinzu
-            num = helperNums(v, num); // Führe rekursiv die dfs-Nummerierung aus+            num = helperNums(w, num); // Führe rekursiv die dfs-Nummerierung aus 
         }         }
     }     }
Zeile 193: Zeile 194:
          
     for (T w : graph.get(v)) {     for (T w : graph.get(v)) {
-        low = Math.min(low, graph.nums(w)); // num-Werte der Nachbarknoten+        low = Math.min(low, nums.get(w)); // num-Werte der Nachbarknoten
     }     }
          
Zeile 203: Zeile 204:
  
 === a) === === a) ===
-//push4(ts, x, y) = Push(Push(Push(Push(ts, x+1, y), x, y+1), x-1, y), x, y-1)// +<code=java> 
 +push4(ts, x, y) = Push(Push(Push(Push(ts, x+1, y), x, y+1), x-1, y), x, y-1)// 
 +</code>
 === b) === === b) ===
-//paintHLine(c, x, y, n, nc) = ...//+<code=java> 
 +paintHLine(c, x, y, n, nc) = 
  
-//... = c, falls n < = 0//+... = c, falls n < = 0
  
-//... = paintHLine(Paint(c, x, y, nc), x + 1, y, n - 1, nc), sonst/+... = paintHLine(Paint(c, x, y, nc), x + 1, y, n - 1, nc), sonst 
-    +</code>
 === c) === === c) ===
-//getCol(New, x, y) = White//+<code=java> 
 +getCol(New, x, y) = White
  
-//getCol(Paint(c, a, b, col), x, y) = ...//+getCol(Paint(c, a, b, col), x, y) = ...
  
-//... = col, falls x = a und y = b// +... = col, falls x = a und y = b
- +
-//... = getCol(c, x, y), sonst//+
  
 +... = getCol(c, x, y), sonst
 +</code>
 === d) === === d) ===
-//floodH(c,Empty,oc,nc) = c //+<code=java> 
 +floodH(c,Empty,oc,nc) = c 
  
-//floodH(c, Push(ts, x, y), oc, nc) = ...//+floodH(c, Push(ts, x, y), oc, nc) = ...
  
-//... = floodH(Paint(c, x, y, nc), push4(ts, x, y), oc, nc), falls getCol(c, x, y) = oc// +... = floodH(Paint(c, x, y, nc), push4(ts, x, y), oc, nc), falls getCol(c, x, y) = oc
- +
-//... = floodH(c, ts, oc, nc), sonst //+
  
 +... = floodH(c, ts, oc, nc), sonst 
 +</code>
 ____________________________________________________________________ ____________________________________________________________________
 ====   Aufgabe 6 (Radix-Exchange-Sortierung)==== ====   Aufgabe 6 (Radix-Exchange-Sortierung)====