• searching algorithms can be done in intervals or sequences
  • sequencial search can take way too long
  • binary search is most efficient for sorted lists
  • for algorithms --> important to understand the question or what is asked
  • we can use if else syntax for that in JS
sum = 24
counter = 5
for i in range (0, 25):
    sum = sum + 2
    counter = counter + 5
def squareroot(i):
    if (i == 0 or i == 1):
        return(i)
    for x in range (1, 100):
     if x*x: 
        return x
def collatz(int):
    while int > 1:
        if int % 2 == 0:
            int = int / 2
            print(int)
        else:
            int = (int * 3) + 1
        print(int)

i = 45
print(collatz(i))
136
68.0
68.0
34.0
34.0
17.0
17.0
52.0
26.0
26.0
13.0
13.0
40.0
20.0
20.0
10.0
10.0
5.0
5.0
16.0
8.0
8.0
4.0
4.0
2.0
2.0
1.0
1.0
None