Component 2 Flashcards
What is computational thinking?
It’s the process of breaking down a problem into simple enough steps that even a computer would understand.
What are the three core concepts of computational thinking?
- Decomposition
- Algorithmic thinking
- Abstraction
What is Decomposition?
Decomposition is when you break down a problem into smaller chunks so they can be solved individually.
What is Algorithmic thinking?
Algorithmic thinking is a logical way of getting to the solution, by taking the problems step by step.
What is Abstraction?
Abstraction is when you select only the important bits from the information given.
What is Pseudocode?
Pseudocode is a way of writing code in a way which is easier to understand.
What is a Flowchart?
A flowchart is a way of visually writing Pseudocode and Algorithims.
What shape is a terminal in flowcharts
Rounded box
How does binary search work?
- Find the midpoint in the list
- If the midpoint is the item you are looking for stop program
- if item you are looking for is greater than the midpoint then check latter half of the list, if not there check other half.
- The list will be half the size, you would need to find the midpoint again and repeat.
What must be true for binary search to work?
The list must be in order(alphabetical or numerical)
How does Linear Search work?
1.The program startes at the first item
2.It compares the item to what we’re searching for
3.If it doesn’t match, repeat until you reach the correct item.
What is the downside to Linear Search?
It is slower than binary search
What does bubble sort do?
It takes an unordered list, and puts it into order.
How does bubble sort work?
- Looks at the first two items
- If they are in the correct order, leave as is
- If they are in wrong order, swap
- Compare 2nd and 3rd and perform same check
- Repeat the process until list is in order.
How does merge sort split work?
- Split the list in halves until there is one item per list
- Merge each item with another item, compare values and rearrange
- Merge them all back together by making comparisons and swapping them around.
What are the pros and cons of merge sort split?
Pros: 1.More effecient, and quicker than bubble sort
2. Consistent running times, as you don’t backtrack as much.
Cons: 1. Not good for small lists
2. If the list is sorted it will still split
3. Uses memory to create many lists.
How does insertion sort work?
1.Check the 2nd item of the list and check if it is greater than the first item
2.If it is in order leave it and check 3rd item
3.Compare 3rd item with the numbers before and put it into the right place
4.Repeat
What are the Pros and Cons of insertion sort?
Pros: 1. Easy to program
2.Good for small lists
3.No extra memory required
4.Easy to add more items
Cons: 1. Bad with larger lists.
What shape box are inputs and outputs in flowcharts?
Parallelogram
What shape are processes in flowcharts?
rectangles
What shape are decisions in flowcharts?
diamonds
What shapes are sub-programs?
Double lined rectangle.
look it up idk?
What are the Pros and Cons of bubble sort?
Pros: 1.Simple algorith that can be easily implemented
2. Effecient to check if list is sorted
3. Doesn’t use a lot of memoery
Cons: 1.Inneficient to sort a list
2. Doesn’t cope with large lists.