2.1 - computational thinking and algorithms Flashcards
what is computational thinking
thinking logically in a way that a computer would
what is abstraction
only focusing on relevant details while ignoring others to create the simplest form of a problem so you can solve it
what is decomposition
breaking a problem down into simpler easier to manage parts that you can tackle one by one
what is algorithmic thinking
generating a series of simple steps to solve the problem
what is a flow chart
a visual representation of an algorithm
what shape represents the start/end of a flowchart
cylinder
what shape shows an input/output
parallelogram
what shape shows a process
rectangle
what shape shows a decision
diamond
what is a trace table
a table that shows variables as they change throughout a program
what is a searching algorithm for
to check if an item is in a list
what is linear search
checking every item in a list to see if one of them is the one you are looking for
what is binary search
checking the middle of a sorted list, and checking if it is higher or lower than the value you are looking for, then remove the half of the list that is on the wrong side, then repeat
pros and cons of binary vs linear search
binary always takes same amount of time and is quicker on longer lists, but requires the list to be sorted, linear search takes a variable amount of time but is quicker on shorter lists
how do you identify binary vs linear search
binary search has a midpoint and first and last variables