Please enable JavaScript.
Coggle requires JavaScript to display documents.
Comp Sci paper 2 revision - Coggle Diagram
Comp Sci paper 2 revision
Algorithms
Computational thinking
Abstraction
Removing unnecessary detail from a problem so you can focus on essential components
Decomposition
Breaking down a large problem into smaller sub-problems
Structure diagram
Used to show how a problem is broken down
Searching algorithms
Binary search
Examining the middle object in each list and halfing it, then halfing it again until you reach the target object - only use if the list is in order
Linear search
Items are examined from left to right until you reach the target item - only use if list is not in order
Sorting algorithms
Bubble sort
Start with leftmost item, compare with next item, swap if higher, repeat
Merge sort
Divide list into two, continue dividing until there is just one item left in each list, merge back together until list is in order
Insertion sort
One item is taken from the list and placed in the right position, this is repeated until list is in order
Flowcharts
Arithmetic operators
MOD - modular (remainder)
DIV - Integer division
Variable
A location in memory in which you can temporarily store a value such as a string or value
Algorithms
A set of instructions
Sub - programs
Used when you wish to call another procedure or function
Pseudocode
Integer
A whole number
Real
A number with a decimal point
Boolean
TRUE or FALSE
String
A sequence of one or more characters
format
A kind of structured English for describing algorithms
Uses sequence, selection and iteration
Interpreting algorithms
Trace table
Determine the outputs from a program as it runs - good for finding errors in the code
Errors
Logical errors, syntax errors, number errors etc.
Programming fundamentals
Fundamentals
Sequence
Selection
Iteration
Arrays
A data structure that allows you to hold many items of data which is referenced by one identifier
Two dimensional arrays
A data structure that stores data in a grid-like format, organized into rows and columns
Procedures
Functions
Constants
Prevent values from being changed accidentally by a part of code
Variables
Values that can change throughout the code
Concatenation
Means joining together
Joins strings together
Comments
Allows you to insert a line of text that will not affect the code
Boolean logic
Logic diagrams
Truth tables