Please enable JavaScript.
Coggle requires JavaScript to display documents.
2.1 Algorithms - Independent study, Computational Thinking, Decomposition,…
2.1 Algorithms - Independent study
Types
Removing unnecessary details from a problem,keeping the important details. Example would be a train map.
Breaking down a problem or system into smaller parts that are easier to manage and maintain,
Decisions
Input/Output
Start/Stop
Process
Sort and Search
Linear
A linear search is a search method that finds an element within a list. It checks each element of the list until a match is found or the whole list has been searched.It does not need to be in order.
Example
Of these numbers when will 177 be found? 12, 144, 82, 123, 177, 1455, 64, 88 It would be found 5th
Binary
Binary search compares the wanted value to the middle element of the array.
How will a binary search find the number 8 in this list? 1, 2, 3, 4, 5, 6, 7, 8
1,2,3,
4
,5,6,7,8 Is 4 greater than 8:No
5,
6
,7,8 Is 6 greater than or equal to 8:No
7
,8 Is 7 greater than or equal to 8:No
8
Value Found
Sort algorithms
Insertion
An insertion sort compares values in turn, starting with the second value in the list. If this value is greater than the value to the left of it, no changes are made. Otherwise this value is repeatedly moved left until it meets a that is less than it. This continues until the end of the list is reached.
Merge
A merge sort uses divides it into multiple lists.The list is repeatedly divided into two until all the elements are separated individually. Pairs of elements are then compared, placed into order and combined. The process is then repeated until the list is merged into one singular list that is in order as a whole.
Bubble
Bubble sort is a sorting algorithm that repeatedly steps through the input list element by element, that then comparing the current element with the one after it, swapping their values if needed
programming constructs
Iteration
a sequence of instructions or code being repeated until a specific condition is met, usually done through a while loop
Selection
Selection is a programming construct where a section of code is run only if a condition is met, an example would be for an IF statement
Sequence
Sequence is the order in which the statements are executed. The sequence is extremely important as carrying out instructions in the wrong order leads to a program performing incorrectly.
Computational Thinking
Decomposition
Abstraction
Flow Chart