Please enable JavaScript.
Coggle requires JavaScript to display documents.
GCSE Computer Science UNIT 2 quiz_00005 (2.2 Programming Techniques…
GCSE Computer Science UNIT 2 
2.1 Algorithms
-
Specific Algorithms
Searching
Linear Search
-
Compare search to list[0]. If match return 0 else compare to list[1]. If not found in list at all return -1
Usually slower, but easy to code
Binary Search
-
Compare search to middle item in list. If match, stop. Else discard the upper or lower portion of the list and repeat
Usually faster, but harder to code
Sorting
Bubble Sort
-
Compares list[0] with list[1] - swaps them if out of order. Then compares list[1] with list[2]. Repeats until first pass has been completed. Then does repeated passes until no swaps are required - list is now sorted
-
Insertion Sort
Compare list(n) with all items that come before it and insert it into the correct position. Repeat for list(n+1).
Quicker than a bubble sort, but still slow for very long lists
-
Merge Sort
Divide and conquer approach, harder to understand
Place each item into its own individual list. Each pair of adjacent lists are combined into one sorted list. Repeat until there is one big final, sorted list.
-
-
-
-
2.3 Robust Programs
-
-
Code MAINTAINABILITY
Written to make it easy for any programmer to
understand, debug and change
-
-
-
-
ERRORS
-
Logic Errors
-
Correct series of instructions but in wrong order
e.g. open file, close file, write to file
-
-
-
TESTING to check program
is stable, bug free and meets
the clients breif
-
Types of testing
-
-
-
-
-
-
BETA - Testing done outside the company by potential users
Bugs reported to developers who fix before final software release
-
-
-
2.6 Data Representation
-
-
Unit Conversion
Binary point values are 1,2,4,8,16,32,64,128 etc
-
Denary to Binary
e.g. 97
97 / 2 = 48 r1
48 / 2 = 24 r0
24 / 2 = 12 r0
12 / 2 = 6 r0
6 / 2 = 3 r0
3 / 2 = 1 r1
1 / 2 = 0 r1
Read from bottom to top!
e.g. 1100001
or in 8 bits: 01100001
-
Non numbers
Text
ASCII is a character set.
Each char has a binary code called a code point
e.g. "A" = 0100001
ASCII uses 7 bits (8th bit is always 0) so there is
not enough code points for all chars in all languages
UNICODE is another character set. It uses 16 bits
for each code point so has enough for all chars in all languages
-
-
-
-