mock Flashcards
Insertion sort
Sort 1 at a time
unsorted left
sorted right
Merge sort
Divide set into 1s
Merge into 2s in order
Merge into 4 by compating first digits at the beginning of each lists
do the same for 8
Bubble sort
Compare pairs
Swap accordingly
Compare - 1/2, 2/,3 3/4…
Final pass to check
Binary search
Check middle (lowest + highest //2)
If bigger:
* remove bottom half
* Find the middle
* Repeat
If lower
* opposite
Binary vs Linear search
Binary:
* Fast for large data sets
* Efficient
* Must be ordered
* Complex
Linear:
* Fast on v. small data sets
* simple
* can work on unsorted
* slow on large data sets
* inefficient
Data types
Real - decimals
String - character sequence
SQL
SELECT (Star or column name)
FROM (table name)
WHERE (Condition)
Compiler pros/cons
Pros:
* Fast
* Optimises code
* Source code isn’t seen
Cons:
* Memory intensive
* Difficult to debug
* Processor specific
Interpreter pros/cons
Pros:
* Stops after error - easier to debug
* Less RAM used
Cons:
* Slower
* Translated every time
* Not optimised
Compiler
- Translates all at once
- All errors will be compiled
- Creates .exe file
Interpreter
- Translates one line at a time immediately
- Stops after an error
HIgh level language pros/cons
Pros:
* Easy to read/ write
* Easy to debug
* Portable
* Multiple commands per line
Cons:
* Can’t manipulate hardware
* Needs translation
* Less efficient
* More memory
Low level language pros/cons
Pros:
* Controls hardware
* less memory
Cons:
* Hard to write/ understand
* Machine dependent
* Prone to errors
* Need to know computer architecture
Iterative vs final tests
Iterative:
* During development
* Every aspect tested
Final:
* End of development
* Test if aspects work together
* Normal, boundary, erroneous
Maintaining programs
- Comments
- White space
- Indents
- Variable names
- Sub-programs
Programming constructs
- Sequence
- Selection
- Iteration
Mesh +/-
+
* No single point of failure
* Expansion/modification doesn’t disrupt network
* Data transmitted from different devices simultaeneously
-
* Redundant connections
* Cabling expensive
* Maintenece / admin difficult
Wireless mesh
- Only 1 node needs wired connection
- More nodes = more data routes
- Node within broadcast distance of 3 others has 3x bandwidth
- 1/2 distance = 4x signal strength
IPV4
- 4 Blocks of denary 0-255 separated by a dot
- Each block = 1 byte
- Full thing is 4 bytes
1.10.100.200
IP overview
- Unique identifier given to devices to communicate over internet
- Dynamic
- Able to control where data goes