diff --git a/utils/literal.py b/utils/literal.py index ac41a93..c574306 100644 --- a/utils/literal.py +++ b/utils/literal.py @@ -21,6 +21,8 @@ class Literal: def __eq__(self, other): """Vergleicht den Wert mit einem anderen Wert.""" + if other is None: + return False assert isinstance(other, Literal), "Can only compare with Literal or MemoryCell" self.compare_count += 1 self.read_count += 1 @@ -29,6 +31,8 @@ class Literal: def __ne__(self, other): """Vergleicht den Wert der Speicherzelle mit einem anderen Wert.""" + if other is None: + return True assert isinstance(other, Literal), "Can only compare with Literal or MemoryCell" self.compare_count += 1 self.read_count += 1 diff --git a/vorlesung/01_grundlagen/euklid.py b/vorlesung/L01_grundlagen/euklid.py similarity index 100% rename from vorlesung/01_grundlagen/euklid.py rename to vorlesung/L01_grundlagen/euklid.py diff --git a/vorlesung/02_elementares_sortieren/bubble_game.py b/vorlesung/L02_elementares_sortieren/bubble_game.py similarity index 100% rename from vorlesung/02_elementares_sortieren/bubble_game.py rename to vorlesung/L02_elementares_sortieren/bubble_game.py diff --git a/vorlesung/02_elementares_sortieren/bubble_sorting.py b/vorlesung/L02_elementares_sortieren/bubble_sorting.py similarity index 100% rename from vorlesung/02_elementares_sortieren/bubble_sorting.py rename to vorlesung/L02_elementares_sortieren/bubble_sorting.py diff --git a/vorlesung/02_elementares_sortieren/insert_game.py b/vorlesung/L02_elementares_sortieren/insert_game.py similarity index 100% rename from vorlesung/02_elementares_sortieren/insert_game.py rename to vorlesung/L02_elementares_sortieren/insert_game.py diff --git a/vorlesung/02_elementares_sortieren/insert_sorting.py b/vorlesung/L02_elementares_sortieren/insert_sorting.py similarity index 100% rename from vorlesung/02_elementares_sortieren/insert_sorting.py rename to vorlesung/L02_elementares_sortieren/insert_sorting.py diff --git a/vorlesung/02_elementares_sortieren/select_game.py b/vorlesung/L02_elementares_sortieren/select_game.py similarity index 100% rename from vorlesung/02_elementares_sortieren/select_game.py rename to vorlesung/L02_elementares_sortieren/select_game.py diff --git a/vorlesung/02_elementares_sortieren/select_sorting.py b/vorlesung/L02_elementares_sortieren/select_sorting.py similarity index 100% rename from vorlesung/02_elementares_sortieren/select_sorting.py rename to vorlesung/L02_elementares_sortieren/select_sorting.py diff --git a/vorlesung/03_fortgeschrittenes_sortieren/heap_game.py b/vorlesung/L03_fortgeschrittenes_sortieren/heap_game.py similarity index 100% rename from vorlesung/03_fortgeschrittenes_sortieren/heap_game.py rename to vorlesung/L03_fortgeschrittenes_sortieren/heap_game.py diff --git a/vorlesung/03_fortgeschrittenes_sortieren/heap_sorting.py b/vorlesung/L03_fortgeschrittenes_sortieren/heap_sorting.py similarity index 100% rename from vorlesung/03_fortgeschrittenes_sortieren/heap_sorting.py rename to vorlesung/L03_fortgeschrittenes_sortieren/heap_sorting.py diff --git a/vorlesung/03_fortgeschrittenes_sortieren/quick_game.py b/vorlesung/L03_fortgeschrittenes_sortieren/quick_game.py similarity index 100% rename from vorlesung/03_fortgeschrittenes_sortieren/quick_game.py rename to vorlesung/L03_fortgeschrittenes_sortieren/quick_game.py diff --git a/vorlesung/03_fortgeschrittenes_sortieren/quick_sorting.py b/vorlesung/L03_fortgeschrittenes_sortieren/quick_sorting.py similarity index 100% rename from vorlesung/03_fortgeschrittenes_sortieren/quick_sorting.py rename to vorlesung/L03_fortgeschrittenes_sortieren/quick_sorting.py diff --git a/vorlesung/04_besondere_sortierverfahren/count_sorting.py b/vorlesung/L04_besondere_sortierverfahren/count_sorting.py similarity index 100% rename from vorlesung/04_besondere_sortierverfahren/count_sorting.py rename to vorlesung/L04_besondere_sortierverfahren/count_sorting.py diff --git a/vorlesung/L05_binaere_baeume/__init__.py b/vorlesung/L05_binaere_baeume/__init__.py new file mode 100644 index 0000000..2dc50f9 --- /dev/null +++ b/vorlesung/L05_binaere_baeume/__init__.py @@ -0,0 +1 @@ +from vorlesung.L05_binaere_baeume.bin_tree import BinaryTree diff --git a/vorlesung/05_binaere_baeume/bin_search.py b/vorlesung/L05_binaere_baeume/bin_search.py similarity index 100% rename from vorlesung/05_binaere_baeume/bin_search.py rename to vorlesung/L05_binaere_baeume/bin_search.py diff --git a/vorlesung/05_binaere_baeume/bin_tree.py b/vorlesung/L05_binaere_baeume/bin_tree.py similarity index 98% rename from vorlesung/05_binaere_baeume/bin_tree.py rename to vorlesung/L05_binaere_baeume/bin_tree.py index 7e6a4d3..a25c8f8 100644 --- a/vorlesung/05_binaere_baeume/bin_tree.py +++ b/vorlesung/L05_binaere_baeume/bin_tree.py @@ -1,4 +1,4 @@ -from bin_tree_node import BinaryTreeNode +from vorlesung.L05_binaere_baeume.bin_tree_node import BinaryTreeNode from utils.project_dir import get_path from datetime import datetime diff --git a/vorlesung/05_binaere_baeume/bin_tree_node.py b/vorlesung/L05_binaere_baeume/bin_tree_node.py similarity index 100% rename from vorlesung/05_binaere_baeume/bin_tree_node.py rename to vorlesung/L05_binaere_baeume/bin_tree_node.py diff --git a/vorlesung/__init__.py b/vorlesung/__init__.py new file mode 100644 index 0000000..e69de29