null
US
Sign In
Sign Up for Free
Sign Up
We have detected that Javascript is not enabled in your browser. The dynamic nature of our site means that Javascript must be enabled to function properly. Please read our
terms and conditions
for more information.
Next up
Copy and Edit
You need to log in to complete this action!
Register for Free
21211359
Computer science unit 2
Description
Includes : Searchs and sorts Programming techniques (sequence, iteration, selection, arrays/lists + subroutines) Translators/compilers (1st generation, 2nd generation ...)
No tags specified
gcse
computer science
algorithms
programming
translators
compilers
searchs
sorts
arrays
lists
subroutines
ocr
mind map
revision notes
computer studies
Mind Map by
джордж гаврилович
, updated more than 1 year ago
More
Less
Created by
Somto Ibeme
over 6 years ago
Copied by
джордж гаврилович
over 4 years ago
4
0
0
Resource summary
Computer science unit 2
ALGORITHMS
Searchs
Linear
searches each item in list, compare w/ target until it matches/finished searching list
does not need to be sorted, simple to understand
inefficient on long lists, takes too long
Binary
needs to be sorted
efficient on large lists
very fast
cancels half of list by finding midpoint
finds midpoint of list
compares with search target
if search target > midpoint - looks at upper bound
continues until found
if search target < midpoint - looks at lower bound
Sorts
Merge
halves list into two until single elements then merges back together in order
efficient on large lists
fastest out of all sorts
too complicated for smaller lists
Insertion
go through data one by one + check if current data is bigger/smaller than the number that was before it
slow + inefficient on large lists
good for small lists, simple + accurate
pass through the array once
Bubble
repeatedly swapping adjacent item if they are in wrong order, until they are in the correct order.
not as efficient, takes many passes
simple to understand + implement
scheduling and sequence
First in first out (FIFO)
stack
Last in first out LIFO\FILO
queue
Least recently used (LRU)
Time aware least recently used (TLRU)
Most recently used (MRU)
Least-frequently used (LFU)
PROGRAMMING TECHNIQUES
Sequence
executed in the order they are written:
total = mark1 + mark2 average = total / 2 print (total, average)
Selection
next statement to be executed depends on whether the condition being tested is true or false
if statement
if average >= 80 then print ("Distinction") else print ("Pass") endif
Iteration
repetition
for... next
execute the loop a specified number of times - for counter = 1 TO 7
while... endwhile
execute the loop while a certain condition is true, tested at beginning
while emailAddress does not contain “@”
do... until
execute loop until certain condition is true, tested at the end of loop
do ... until emailAddress contains “@”
not in python, used for pseudocode
TRANSLATORS/COMPILERS
1st generation
machine code
Directly Executable by the processor, computer understands
hard to debug, hard to understand, difficult to program in
0001 - input 1100 - store 0010 - output
no translator needed
2nd generation
assembly code uses mnemonics
easier to program in compared with 1st generation but still difficult
slower than 1st generation- needs to be translated
One Assembly Language instruction translates to one Machine Code Instruction (1-1 relationship)
uses assembler to translate
used to program Device Drivers
control the operation of a Hardware Device, GCD
3rd generation
uses compiler to translate: translates in 1 go + displays error message afterwards
harder to debug, hardware specific - suited to certain computer
uses interpreter to translate: translates as program running (line by line) + if error found interpreting stopped; if not continue
longer to run, slower
easier to understand (uses English like key words) easier to debug
One instruction translates into many machine code instructions
ARRAYS/LISTS
data structure that is fixed in size, capable of storing data, accessed by an index
use 0 based counting (starts at zero)
sorce = [ ]
declaration
memory set aside for contents, giving name to memory space
x
score[0] = 3
3 is value to be stored at index
assingment
putting data into memory location
x = 6
0 is position in list
score = [1,2,3,4,5]
scores[0] = 4
score = [4,2,3,4,5]
changed value stored at position 0
SUBROUTINES
code broken up into manageable segments
set of program instructions that do specific task
call
execute subroutine
Menu ()
instruction that starts subroutine
parameters
info about data being passed to a function in brackets
def FirstTask (textToDisplay, num) :
num + textToDisplay = paramters
arguments
value passed to parameter
meal = input("Enter meal") price(meal)
sending response to subroutine
function
section of code, performs specific task, returns value
algorithm to calculate VAT
procedure
does not return value
algorithm for making a square
Show full summary
Hide full summary
Want to create your own
Mind Maps
for
free
with GoConqr?
Learn more
.
Similar
OCR GCSE History-Paper Two: The Liberal Reforms 1906-14 Poverty to Welfare State NEW FOR 2015!!!
I Turner
Latin Literature Exam Techniques
mouldybiscuit
Geography Quiz - Tectonics
oscartaylor
4. Civil War
ShreyaDas
How does Virgil build up tension in the death of Nisus?
mouldybiscuit
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
Maths GCSE - What to revise!
livvy_hurrell
Computing Hardware - CPU and Memory
ollietablet123
GCSE Biology B2 (OCR)
Usman Rauf
C1 Quiz
Leah Firmstone
Biology Revision - Y10 Mock
Tom Mitchell
Browse Library