Save
computer science
yt cs
whole paper 2 cs
Save
Share
Learn
Content
Leaderboard
Learn
Created by
anisah
Visit profile
Cards (76)
Algorithm
A
sequence of steps that can be followed to complete
a
task
View source
Algorithmic
thinking
Solving
problems
by defining steps and the
sequence
needed
View source
Program
code is just implementing an algorithm
View source
Algorithms
Can be
represented
in
pseudocode
Can be represented in
flowcharts
View source
Pseudocode
Resembling
code but more
relaxed
View source
Flowchart
Has a set group of symbols including start/end,
process
,
sub-program
, input/output
Uses a
diamond
for selection decisions
View source
Abstraction
Removing
unnecessary
detail from a problem
View source
Decomposition
Breaking down a problem into
sub-problems
View source
Structure diagram
Represents
decomposition
of a larger problem into
sub-problems
View source
Trace
table
Shows how values change when an
algorithm
is carried out
View source
Trace
tables
Go through every
line
of code
Only
add
to a
column
when that value changes
Generally move to a new
row
when moving to a new
block
of code
View source
Linear
search
Looks for a
target
by
comparing
each item in a list one by one
View source
Binary
search
Compares the middle item to the target,
discards
half the list, and repeats until the target is found or the list is
exhausted
View source
Searching
algorithms
Linear
search doesn't require the
list
to be ordered
Binary
search requires the
list
to be ordered
View source
Bubble
sort
Does a series of
passes
,
swapping
pairs if needed, until a full pass happens with no swaps
View source
Merge sort
1.
Divide
the list continuously by
two
until each list has one item
2.
Merge
the lists back together keeping them in
order
View source
Insertion sort
Starts with one item in a sorted part, moves items one by one from the
unsorted
part to the
sorted
part
View source
In
section
A
of the exam, you can answer algorithm questions in your own way
View source
In section
B
of the exam, you may need to answer in a programming
language
, either a real one or the OCR exam reference language
View source
Data
types
Integer
Real
(float)
Boolean
String
Character
View source
Casting
Converting
between
data types
View source
Arithmetic
operations
Addition
Subtraction
Multiplication
Division
(real and integer)
Exponentiation
View source
Modulus
Gives the
remainder
of a division
View source
Comparison
operators
Equal
to
Not
equal
to
Greater
than
Greater
than or
equal
to
Less
than
Less
than or
equal
to
View source
Boolean
Logical operations of
AND
and
OR
View source
Substring
Extracts
part of a string
View source
Concatenation
Joining
two
strings together
View source
Variable
An identifier that holds a value that can be
changed
View source
Constant
An identifier that holds a value that
cannot
be changed
View source
Getting
user input
1.
Assign
the user input to a
variable
2. May need to cast the input to a
different
data type
View source
Random function
Generates a random number
View source
Programming
constructs
Sequence
(lines executed in order)
Selection
(if/elif/else statements, switch statements)
Iteration
(for loops, while loops, do-until loops)
View source
While
loop
1.
Repeat
until a condition is
broken
2. Useful when you don't know how many times the loop needs to
repeat
View source
Do until loop (do while loop)
1. Repeat until a condition is
met
2. Runs at least once even if
condition
is
false
View source
Subprogram
(
subroutine
)
Named
out-of-line
block of code
View source
Procedure
Type of
subprogram
View source
Function
Type of
subprogram
that has a
return
value
View source
Parameter
Variable used as an input to a
subprogram
View source
Return value
Output from a
subprogram
View source
Local variable
Variable that only exists when the
subprogram
is executing and is only
accessible
inside the subprogram
View source
See all 76 cards