initial commit

This commit is contained in:
hoffmeisterda104361 committed 2026-10-19 20:29:13 +02:00
commit 39f56a3b10
83 files changed
+3583

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
new_lst = ["Alex", "Moin", "ka", "world", "Zh", "lakj"]
s_lst = sorted(new_lst)
def bnr_search(lst, target):
low = 0
high = len(lst) - 1
while low <= high:
mid = (low + high) // 2
if lst[mid] == target:
print("found target")
return mid
elif lst[mid] < target:
low = mid + 1
else:
high = mid - 1
return None, print("not found")
bnr_search(s_lst, "Alex")
+9
View File
@@ -0,0 +1,9 @@
new_lst = ["Hallo", "Alex", "Moin", "ka", "world", "Zh"]
def lin_search(lst,target):
for element in lst:
if element == target:
print(f"found '{element}' in {lst}")
print("finished search")
lin_search(new_lst, "Alex")
+7
View File
@@ -0,0 +1,7 @@
list_of_ints = [5, 55, 2, 7, 45, 3, 1, 8, 23, 12]
list_of_ints.sort(reverse=False)
print(list_of_ints)
l = ['Hallo', 'Alex', 'Moin', 'ka', 'world', 'Zh', 'lakj']
new_sorted_list = sorted(l, key= len)
print(new_sorted_list)