• why is it important to know that algorithms that look different can do the same thing and that algorithms that look the same might have different results? It is important to know that algorithms look different because that way you know that there is more than one way to solve the problem and you know how to approach the code if there is something wrong with it and you can start fixing it.

screenshot

This is a binary tree and it works by taking the middle value and then putting the sides after that. The list for this is [92,43,74,66,30,12,1]

b. [-1, 2, 6, 9, 19]

  • Binary cannot have any negative numbers or signs, so this example would not work in a binary search.

When collaborating or working on group projects, two people might come up with two different ways to solve a problem, and that happens a lot.

  • know that same goal can be achieved in many ways (the possibilities are endless)
  • make notes in you code! (explain how it works to others or you future self)
am_sick = False
am_not_sick = True

# setting variables here (same as above to make comparison easier)
driveSchool = not(am_sick) and am_not_sick
if driveSchool == False:
    print("I don't want to go to school")
if driveSchool == True:
    print("I'll go to school")
I'll go to school

I think the code above is a Boolean because it had true or false.