Algorithms Reflection/Key Points

I learned a lot from algorithms, because they are important for data storage, sorting and processing, and machine learning:

Algorithms: These are like step-by-step instructions for computers. We learned about different types, like sequences, selections, and iterations.

Pseudocode: It’s like planning out what to do before writing actual code, so everyone understands the plan.

String Operations: We can do cool things with words, like combining them or cutting parts out. For instance, you can create a new word by adding two words together, just like this:

new_word = "Hello" + "World

Or, you can pick out a part of a word like this:

word = "Computer"
part = word[0:4]

Fibonacci Sequence: This is a list of numbers where each number is the sum of the two before it. We can create this sequence with code, like this:

f0 = 0
f1 = 1
fib_list = [f0, f1]

for i in range(n-2):
    x = fib_list[-1]
    y = fib_list[-2]
    fib_list.append(x + y)

Bubble Sort: We also learned how to sort a list of numbers using the bubble sort algorithm. It’s like organizing a messy room step by step.

numbers = [5, 3, 8, 1, 7]
n = len(numbers)

for i in range(n):
    for j in range(0, n-i-1):
        if numbers[j] > numbers[j+1]:
            numbers[j], numbers[j+1] = numbers[j+1], numbers[j]