Chapter 21 Digital Design Principles Flashcards
What is abstraction?
Abstraction involves removing specific details from a problem that are not needed to solve it.
What is decomposition?
Decomposition involves breaking a large, complex problem into smaller sub-problems and then solving each one individually. The small solutions can then be brought together to provide an overall solution to the complex problem.
What is the Graphic and Purpose of a Flow Line?
The purpose of a flow line is to indicate the flow of logic and connect the different symbols together. A flow line is displayed as an arrow on a flow chart.
What is the Graphic and purpose of a Terminal?
A Terminal (stop/start) represents the start and end of the flowchart. It looks like a rectangle with smooth curves.
What is the graphic and purpose of input/output in a flow chart?
Input/output indicates an input or output of data. It is displayed as a parallelogram on a flow chart.
What is the graphic and purpose of a process in a flowchart?
A process indicates that an operation is to be done. There is usually text in the box. A process is displayed as a rectangle in a flowchart.
What is the graphic and purpose of a decision in a flowchart?
A decision asks a question; there are a number of alternative answers and a pathway is selected based on the response to the question. A decision is displayed as a rhombus in a flowchart.
What is the graphic and purpose of a sub-routine?
A sub-routine represents a call to a sub-routine. It is displayed as a rectangle with 1 vertical line through the rectangle near the end of each side of the rectangle.
What is the graphic and purpose of a document/report in a flowchart?
A document/report indicates that a report or document is used or produced. It is displayed as a rectangle-like shape; the top of the rectangle is normal but the bottom is sort of curved.
What do you use instead of print(“example”) when writing pseudocode?
You write OUTPUT “example”
What are the 2 sorting algorithms needed for GCSE?
Bubble sort and insertion sort.
How does the bubble sort work?
- Adjacent values are compared; if they are out of sequence, they swap positions.
- At the end of the first pass, the largest value is in the last position in the array.
-Multiple passes are performed before the data is fully sorted.
Here are some numbers: 35 38 12 995 13 Solve them using bubble sort.
Pass 1: 35 12 38 13 995
Pass 2: 12 35 13 38 995
Pass 3: 12 13 35 38 995
Pass 4: 12 13 35 38 995
How does the insertion sort work?
Each comparison examines two adjacent elements in the array of data. If two adjacent elements are out of sequence, they are swapped and the smaller value is added to the sorted sub-list in the correct order.
At the end of one full pass, the array of data is fully sorted.
Explain a disadvantage of Bubble sort.
Inefficiency- bubble sort is inefficient for sorting large amounts of data - the time taken to sort data is related to the square of the number of items to be sorted.