Set 8 Flashcards
Need to add time complexity cards. card 36 needs updating
Why is space complexity important to consider when analysing binary tree search?
Because the algorithm is recursive, it places a demand on the call stack
Merge sort complexity
O(n log n)
Give two reasons why smaller time complexity is better
- A quicker program could solve more of the same problem or run more programs in the same time period
- Computers consume electricity to run…
Give two reasons why a smaller space complexity is better
- A program that uses less memory could run off cheaper hardware (as less RAM is needed)
- Or a greater number of different algorithms can run on the same hardware simultaneously
What is the purpose of Dijkstras algorithm?
Can the graph be directed/weighted?
- Calculates the shortest path between a node and all other nodes in a graph
- Graph may be directed or undirected
- Graph must be weighted
What approach does merge sort take to sort a list?
Divide and conquer
What is bubble sort’s time complexity? Why?
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 swapping all the way down the list.
Hierarchy of complexities (polynomial, logarithmic, constant, exponential, linear)
constant < logarithmic < linear < polynomial < exponential
What is a first class object?
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
What does function application mean?
Applying a function to its arguments
What does partial function application mean?
Parțial function application means only applying a function to some of its arguments. The result is a function.
What is the purpose of a domain name?
- 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
What is the purpose of a domain name server?
To translate a fully qualified domain name into its corresponding IP address
What is the domain name system?
- The domain name system is a distributed database of mappings from FQDNs to their corresponding IP addresses
- DNS servers are organised into a hierarchy
What happens if a domain name server cannot resolve a lookup?
The query will be passed to another DNS server
Who manages top level domains?
- An (internet) registry
- Each TLD may have restrictions as to who can use it
What are the main responsibilities of an internet registry?
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
Give two examples of top level domains
.uk .org
What is meant by baud rate?
The maximum number of signal changes in a medium per second
What is meant by bit rate?
The number of bits transmitted over a medium per second
Bit rate equation
bit rate of channel = (baud rate) x (number of bits per signal change)
What is Serial Data Transmission?
Bits are sent one after the other over a single wire from source to destination
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
Give two problems with Parallel Data transmission
- Unreliable because of skew
- Parallel wires also suffer from crosstalk