Set 8 Flashcards

Checked by Tim. (44 cards)

1
Q

Why is space complexity important to consider when analysing binary tree search?

A

Because the algorithm is recursive, it places a demand on the call stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the Merge sort algorithm’s complexity

A

O(n log n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Give two reasons why smaller time complexity is better

A
  • A quicker program could solve more of the same problem or run more programs in the same time period
  • Computers consume electricity to run so a program taking less time to run will cost less money
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Give two reasons why a smaller space complexity is better

A
  • A program that uses less memory could be run on cheaper hardware (as less RAM is needed)
  • Or a greater number of different algorithms can run on the same hardware simultaneously
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the purpose of Dijkstras algorithm?
Can the graph be directed/weighted?

A
  • Calculates the shortest path between a node and all other nodes in a graph
  • Graph may be directed or undirected
  • Graph must be weighted
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What approach does merge sort take to sort a list?

A

Divide and conquer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is bubble sort’s time complexity? Why?

A

O(n^2). Since it involves a for loop within a for loop. You need to do n passes of the list/array, and each pass involves up to n comparisons.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Hierarchy of complexities (polynomial, logarithmic, constant, exponential, linear)

A

constant < logarithmic < linear < polynomial < exponential

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a first class object?

A

First class objects are objects which may:
- R - be returned in function calls
- A - be assigned as arguments
- V - be assigned to a variable
- E - appear in expressions

Functions are first-class objects in functional programming languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does function application mean?

A

Applying a function to its arguments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does partial function application mean?

A

Partial function application means only applying a function to some of its arguments. The result is a function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a URL?

A
  • A Uniform Resource Locator (URL) is the address of a webpage or other internet resource
  • It indicates the location of a resource as well as the protocol used to access it.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a domain name server?

A

A server that contains databases which map FQDNs to their corresponding IP addresses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

‘www.w3schools.com’ is an example of a…

A

Fully qualified domain name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

‘www’ is an example of a…

A

Host name or subdomain

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

‘w3schools.com’ is an example of a…

A

Domain name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

‘/cs/cs_operators.asp’ is an example of a…

A

Path

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Describe how domain names are organised

A
  • Hierarchical organisation
  • Top level domains are com/org/uk etc
  • Second level domains are ac/co etc
  • Domains can have subdomains created for them
19
Q

What is the purpose of a domain name?

A
  • A domain name identifies an organisation or individual on the internet.
  • They use alphanumeric characters which make them easier for humans to remember than IP addresses
20
Q

What is the purpose of a domain name server?

A

To translate a fully qualified domain name into its corresponding IP address

21
Q

What is the domain name system?

A
  • The domain name system is a distributed database of mappings from FQDNs to their corresponding IP addresses
  • DNS servers are organised into a hierarchy
22
Q

What happens if a domain name server cannot resolve a lookup?

A

The query will be passed to another DNS server

23
Q

Who manages top level domains?

A
  • An (internet) registry
  • Each TLD may have restrictions as to who can use it
24
Q

What are the main responsibilities of an internet registry?

A

To maintain a definitive register of who owns a specific domain.
To enter domain names to IP address mappings into the DNS system
The ensure domain names are unique, and only used by one organisation

25
Give two examples of top level domains
.uk .org
26
What is meant by baud rate?
The maximum number of times that a signal **changes per second**.
27
What is meant by bit rate?
The number of bits transmitted over a medium per second
28
Bit rate equation
bit rate of channel = (baud rate) x (number of bits per signal change/sample/word length)
29
What is Serial Data Transmission?
Bits are sent one after the other over a single wire from source to destination
30
What is Parallel Data transmission?
- Multiple bits are sent simultaneously over multiple wires from source to destination - Each bit is sent down a different wire
31
Give two problems with Parallel Data transmission
- Unreliable over long distances because of **skew** - Parallel wires also suffer from **crosstalk**
32
What is skew?
As each wire has slightly **different properties**, there is a possibility bits could travel at **different speeds** over each of the wires and arrive at **different times**, meaning the signals might **overlap**
33
What is cross-talk?
Interference between different lines, which causes data corruption
34
Give three advantages of serial over parallel transmission
1. Serial transmission doesn't suffer from **skew or cross-talk** 2. Serial is **reliable** over much longer distances 3. Serial transmissions tends to be **cheaper**, as there is much less complexity and the physical size of cables is smaller
35
What is bandwidth? What unit is it measured in?
- A measure of the maximum capacity of a communication channel - It is directly proportional to bit rate - Measured in bits per second
36
What is latency?
A time delay before some component in a computer system responds to an instruction
37
What is synchronous transmission?
- Data is transferred at regular intervals, synchronised by a clock signal - Receiver and transmitter clocks are synchronised
38
What is asynchronous transmission?
- Receiver and transmitter clocks only need to be **synchronised for the duration of data transmission** - Blocks of data are sent as soon as they are ready
39
How are start and stop bits used in asynchronous transmission?
- Start bit is sent to synchronise the clock in the receiver to the transmitter clock - Stop bit allows the receiver time to process the current block of data before another is sent - Stop bit is opposite to start bit to allows the next start bit to be recognised
40
What is a worm?
A piece of malicious software that can self-replicate between computers, either within a network (such as the Internet) or by a user downloading and running and malicious files. Unlike viruses, worms are **complete programs** - they do not require a **host program** to cause damage.
41
What is a virus?
* A virus is a small program of **self-replicating** software that is **attached to other program or files** * Viruses require a **host file** in which to reside
42
What is a trojan?
* A type of malware that is disguised as a legitimate benign file that users can be tricked into opening * They can delete and modify data and allow more malware in once they are opened
43
How can you prevent malware?
1. Improving code quality 2. Monitoring 3. Protection
44
Describe Monitoring, Protection, and Code quality measures that can be used to reduce the threat posed by viruses. Give 2 points for each of monitoring, protection and code quality.
**Monitoring** Any 2 from: -Firewall could block packets from sources -Proxy server could receive/check downloaded files; -Spam filters can block emails from suspicious sources -Web filters can check websites against a list of websites known for having content that might contain a virus; -Digital certificates can be used to verify the source of a downloaded file; -Digital signature can be used to verify that a file has not been changed **Protection** Any 2 from: -Anti-virus -Enable automatic update of applications -Use a virtual machine to execute programs -Set access rights to minimise risk of viruses being able to access sensitive files -Disable execution of macros in documents from outside sources -Restrict execution of software from unverified sources -Encrypt files so that data cannot be extracted from them -Backup data and keep offline so it can be recovered -Disable the use of external drives -Use a computer with the Harvard architecture to prevent data being executed as code -Use a MAC address allow list so that only known devices can join a network **Code Quality** Any 2 from: -Ensure code does not allow buffer overflow -Test software for security vulnerabilities -Carry out a code review so the code is independently checked by another programmer -Use code analysis software to identify flaws -Only use libraries from the internet if required