Professional Documents
Culture Documents
My Notes
My Notes
My Notes
Algorithm
Successful Algorithm
Written Descriptions
Flowcharts
Pseudocode
Variable
Constant
Identifier
Chapter 2
Selection
Iteration
Condition
Chapter 3
Bubble Sort
Compare the value in position 2 and position 3 in the list and swap if necessary.
Merge Sort
Merge Sort is a sorting algorithm that breaks a list into its component parts
and then builds it up again with them in the correct order.
Brute force
Brute force is an algorithm design that does not include any techniques to
improve performance, but instead relies on the computing power to try all
possibilities until the solution to a problem is found.
Linear Search
Linear search starts at the beginning of the list and goes through it, item by
item, until it finds the item it is looking for or reaches the end of the list without
finding it.
Binary Search
A binary search compares the search item with the median item in a list,
repeatedly splitting the list in half until the item is found or there are no more
items left to search.
The list must have been sorted into ascending or descending order. It will not
work on an unsorted list.
Chapter 4
Decomposition
Abstraction
Chapter 5
Why are variables needed?
Program
Data Types
Type Coercion
Selection
Nested IF
Relational Operators
Relational operators are the operators that test the relationship between
two entities. Relational Operators are used to compare two values.
Equal to ==
Not equal to !=
Logical Operators
And
The two conditions must both be true for the whole statement to be true.
Or
Either one condition must be true for the whole sentence to be true.
Not
The NOT operators reverse the logic of the AND and OR statements.
Iteration
Definite Iteration
Indefinite Iteration
An indefinite iteration is used when the number of times a loop will need to
be repeated is not known in advance. Indefinite loops are repeated until a
specified condition is reached. E.g. While loop
Nested Loops
Random Numbers
Chapter 6
Why it is important to make your code easy to read?
Comments
To explain what each part of the program does
Descriptive names
To make the purposes of variables and constants clear
Indentation
Wrong indentation will result in unexpected outcomes.
White space
Blank lines between different blocks of code makes them stand out.
Chapter 7
String
Length of strings
len(variable name)
String traversal
variable[index]
This will output “m”.
variable.lower
variable[phrase index]
Concatenation
“string” + variable
Chapter 8
Data structure
Array
A list is very similar to an array but lists are dynamic. They do not have a
fixed size and can grow as new elements are added.
Declaring a list
variable = [ ]
Multidimensional arrays
Records
Chapter 9
Validation
Range check
Presence check ensures that a value has been entered, preventing the
user from leaving an input blank.
Look-up check
Length check
It checks that the length of a value entered falls within a specified range.
Testing validation rules
Normal data
This is within the limit of what should be accepted by the program.
Boundary data
This is the data that is at the outer limits of what should be accepted by a
program.
Erroneous data
This is the data that should not be accepted by the program.
Chapter 10
Subprogram
Global variable
A global variable is a variable that can be used anywhere within the main
program.
Procedure
Arguments
Arguments are the data that are passed from the main program to the
function.
Parameter
Parameter are the variables that are used to store the data passed from
the main program as arguments.
Bulit-in functions
Chapter 11
Logic errors
Trace table
Trave table is a technique used to identify any logic errors in algorithm.
Each column represents a variable and each row a value of that variable.
Syntax errors
Runtime errors
A runtime error is an error that occur when the computer tries to run code
that it cannot execute. They are the most difficult to predict and spot.
IDE is a package that helps programmers to develop code. Its features are
syntax highlighting, code auto complete, auto indent and debugger, which
detects errors in the code.
To check response to
erroneous data
Evaluating programs
Requirements –
Chapter 14
1 byte = 8 bits
1nibble = 4 bits
Compression
Compression is changing the format of a data file so that the size of the file
becomes smaller.
Bandwidth
Users don’t waste time while their data is being transferred or saved.
Providers can store data in as little space as possible.
Compressed files use less network bandwidth to upload and download.
There is less internet congestion and it makes possible the streaming of
video and audio files.
Loseless compression
Lossy compression
The string of repeated items is called a run and is represented by two bytes.
ccc string of repeating items
3c
c item of information
Chapter 16
The input-process-output model
Sequential model
In the sequential model the instructions are in the algorithm are processed
step by step, in order, from start to finish.
Parallel model
Multi-agent model
Instruction set is the list of all possible commands a particular CPU knows
how to carry out.
Machine code
Translator
Source code
The text of the program that a programmer writes is called source code.
Assembler
Assembly language
Mnemonic
Compiler
Interpreter
Chapter 21
Network
Server
Network services
provide extra storage
back-up facility
accessing shard files
download data or updates
shared printer
access to the internet
communication
A personal area network is a network used for data transmission over short
distances by computer devices. The devices usually communicate wirelessly
over distances of up to 10 meters by radio waves using Bluetooth.
Bluetooth
Client-server network
A client-server network is a network that has at least one server to provide
services to the client computers.
Peer-to-peer network
Network topology
Bus
The more devices that are added to the network, the slower
it runs.
Ring
Disadvantages – Whole network will fail when either the cable or a device fail
Star
Disadvantages – If the hub or switch is failed, the whole network will fail
Expensive to install
Mesh
Wired or wireless
Chapter 22
Confidentiality
Ensuring only authorized users can access the parts of a network and its
resources
Stopping misuse
Encrypting data
Correctness
Availability
Protection should be put in place to prevent failure caused by viruses and denial
of services (DoS) attacks.
Authentication
Access control
Access control is the method that controls whether a particular user will
gain access to a particular file.
Read-only access
read and write access (modify access)
full control – permission to delete a file
Firewall
A firewall is a network security system that monitors and controls data that
is moving from one network to another. Firewall sits between the internet and the
LAN and inspects the incoming and outgoing data. It uses a set of rules which
can be customized by the organization that owns the firewall.
Rules can:
stop certain protocols (e.g. FTP)
block data coming from and going to certain network addresses
stop hacking by disallowing data that matches the pattern an attacker
would use.
Physical security
Physical security can ensure that critical parts of the network can only be
physically accessed by authorized people, such as network technicians or a
system administrator. It involves installing a burglar alarm, security tagging and
physically locking down equipment, etc. By using an electronic lock system,
entry/exist times can be recorded, and individual cards/fobs can be deactivated if
lost.
However, you can encrypt your data to reduce some of these risks.
Therefore, in order to minimize the security risks, users must use a complex
password, remove any default passwords and ensure that all software updates
are applied.
USB
USB flash drives are easy to transport, relatively cheap for the amount of storage
available and very convenient to use.
The disadvantage is that the small drive can easily be lost. But encrypted USB
flash drives are available.
Cyber attack
Phishing
Shoulder surfing