Save
CS paper 1
Save
Share
Learn
Content
Leaderboard
Learn
Created by
poppy
Visit profile
Cards (21)
Decomposition
- breaking complex problems into
smaller
problems and solving each individually.
Abstraction
- picking out important features of a problem and
ignoring
the rest.
Pseudocode
-
quicker
to write, easy to convert.
flowcharts
A)
start/end
B)
connects shapes
C)
input/output
D)
process
E)
decision
5
Binary search
- finds middle
continuously.
Requires the
list
to be
ordered.
Linear search
- checks each item of the list. Can be
unordered.
Takes
longer
on
large
lists.
Bubble
sort -
swaps
elements in list. Simple, takes a
long
time.
Merge
sort - splits list and pairs together. Faster on large lists, uses more
memory.
Integer
- whole number only
Float
- number w decimal point
Boolean
- two values (true/false)
Character
- single letter, number, symbol
String
- represent text
Selection
- order steps carried out in. IF, THEN, ELSE.
Iteration
- number of times repeated until condition met. WHILE,
REPEAT
- UNTIL,
FOR.
Subroutines - sets of instructions stored under one name. Will always return a value.
Local variable
- only used in structure declared in.
Global variable - used any time after declaration.
One dimensional arrays
- stored in a single row, a list.
Two dimensional arrays - stored in a table structure, rows and columns.
len(string)
- return number of characters in string.
string.index
(substring) - returns the index/position of the
first
occurrence of substring in the string.
string
[x] - extracts character at position x in string.
string
[x:
y
] - extracts position of x and positions up to but not including y.
string.upper
() - returns string in uppercase.
string.lower
() - returns string in lowercase.
string.isdigit
() - returns true if string contains only
digits
and
false
otherwise.