Algorithms Flashcards
What is decomposition?
Breaking down a complex problem into smaller problems that can each be solved individually.
What is abstraction?
Picking out important information from a problem and ignoring the rest.
What is algorthmic thinking?
A logical way of getting from the problem to the solution. If the steps taken to solve a problem follow an algorithm then they can be adapted to other problems.
What is the shape for start or stop in a flowchart?
Rounded rectangle
What is the shape for inputs/outputs in a flowchart?
parallelagram
What is the shape for processes in a flowchart?
Rectangle
What is the shape for decisions in a flowchart?
Diamond
What is the shape for subroutines in a flowchart?
A rectangle with an additional parallel line going down on either side.
What are the three types of flowcharts?
- Sequences,
- Iteration,
- Selection
What are search algorithms?
Instructions that search for a specific set of data in a data set.
What are the two main types of search algorithms?
- Binary
- Linear
How does binary search work?
- Take the middle value of your set of sorted data using (n + 1)/2
- If this data is what you are looking for you are done,
- If not, compare the item you are looking for with the middle item, if it is greater then get rid of the lower side from the middle term, if it is smaller than the middle item then get rid of the greater side of the data,
- Repeat steps 1 to 3 until you have found your data.
How does linear search work?
It goes through a whole list (does not have to be ordered, unlike binary search) and looks for your item one item at a time.
What are sorting algorithms?
They are sets of instructions that sort data in order.
What are the two main types of sorting algorithms?
- Bubble,
- Merge