Unit 3 Lesson 9 and 11 Notes

Some Boolean expressions can be written as equivalent conditional statements

Different algorithms can be developed or used to solve the same problem

Algorithms can be written in different ways and still accomplish the same tasks

Algorithms that appear similar can yield different side effects or results

Some conditional statements can be written as equivalent Boolean expressions

Using existing correct algorithms as building blocks for constructing another algorithm has benefits such as reducing development time, reduce testing, and simplifying the identification of errors.

Knowledge of existing algorithms can help in constructing new ones. Some existing algorithms include: Determining the maximum or minimum value of two or more numbers. Computing the sum or average of two or more numbers. Identifying if an integer is or is not evenly divisible by another integer. Determining a robot’s path through a maze.

Vocab

Selection: is a decision or question. At some point in an algorithm there may need to be a question because the algorithm has reached a step where one or more options are available.

Algorithm: A process or set of rules to be followed in calculations or other problem solving operations, especially by a computer.

Iteration: Repeating steps, or instructions over and over again. ( this could be also often called a loop )

Question 4

binary search tree for [1,2,3,4,6,9,11,69]

Question 5

To get 69, begin with the middle index and move on to the following numbers by dividing the first and last indexes by two. You continue until you reach number 69.

Question 6

Question 7

[“Market”, ”Ralphs”, “store”, “Target”, ”Walmart”]

In alphabetical order

Question 8

Binary search automatically rules out half of the options with each iteration,therefore, it is much faster than sequential search. Since you begin at the middle index, you can either select the group that is higher or lower than the middle index.

Question 9

Binary Search Tree for [64,36,16,11,9]

I would find the number 16 which would only take one check since it is the first middle index number

Reflection

Overall, I found these Hacks to be very helpful because they were not so hard where I had not clue what to do forcing me to get help from someone else, but instead offered a challenging yet doable problem set. I learned a lot because the questions got a ibt harder and harder throughout helping me build as I went along. These lessons were a bit challenging at first but with perserverance I was able to understand the concepts which allowed me to perform the hacks well. The presentation was great and I learned a lot from it. I think it was overall good.