2.1 - Algorithms Flashcards
What is computational thinking?
A problem-solving method using computer science techniques, where possible solutions are developed and presented in a way that can be understood by humans and computers.
What are the important elements of computational thinking?
- Decomposition
- Abstraction
- Algorithmic thinking
What is decomposition?
Breaking down a complex problem or system into smaller parts that are more manageable and easier to understand
—> Smaller parts can be examined as they are simpler to work with
What is abstraction?
Involves removing unnecessary detail from a problem in order to concentrate on those that are needed
Why is abstraction used?
Bc it simplifies a problem to make it less complex
—> Makes it more straightforward to understand the problem & create a solution
What is algorithmic thinking?
Involves using logical steps to
find a solution to a complex problem.
What is an algorithm?
A set of instructions for solving a problem or completing a task
Why would programmers create algorithmic designs?
As a method of planning a program before writing any code
—> Helps them to consider potential problems of the program & makes it easier to start creating source code
What does this flowchart symbol mean?
Start / stop terminator
What does this flowchart symbol mean?
Operation (process)
What does this flowchart symbol mean?
Decision
What does this flowchart symbol mean?
Input / Output
What does this flowchart symbol mean?
Direction of flow
What does this flowchart symbol mean?
Subroutine
What are trace tables?
Used to track the value of variables as a program is run
What is a Linear search?
Each data item is searched in order from the 1st value to the last
What is a Linear search also known as?
A sequential search
What type of lists are linear searches best for?
Small data sets
What is an advantage of a Linear search?
The list does not have to be ordered before it is searched
What is a binary search?
The middle point of the data is selected w/ each iteration and many data items can be ignored
What is a disadvantage of a Binary search?
The list of data must be already sorted
What is a advantage of a Binary search?
More efficient than linear
What type of lists are binary searches best for?
Large data sets
What is a Merge sort?
Divides a list into half, again and again until each data item is separate
—> Based on idea of “divide and conquer”
What is the bubble sort?
Data elements are swapped if they r not in the correct order
What type of lists are bubble sorts best for?
Small sets of data
What is the insertion sort?
Values from the unsorted part are checked and inserted at the correct position in the sorted part
—> This continues through all elements of the list until the last item is reached & sorted