NZ Scholarship Digital Technologies study materials
NZ Scholarship Digital Technologies study resources

NZ Scholarship Digital Technologies cheat sheet

NZ Scholarship Digital Technologies · Keep the key ideas within reach.

Quick reference

Digital Technologies

  • Complexity classes: O(1) < O(log n) < O(n) < O(n log n) < O(n^2) < O(2^n) < O(n!). Nested loops over the same input multiply, giving O(n^2) for two levels.

  • Logarithm base does not change big-O class: O(log_2 n) and O(log_10 n) are both written O(log n). Binary search halves the search space each step, so it is O(log n) on sorted data.

  • Stable sort preserves the relative order of equal keys; comparison sorts cannot beat O(n log n) in the worst case. Merge sort is stable and O(n log n); quicksort averages O(n log n) but is O(n^2) worst case.

  • Hash table average lookup is O(1); worst case degrades to O(n) when many keys collide. A balanced binary search tree gives O(log n) search, insert and delete guaranteed.

  • Stack is last-in-first-out (push/pop); queue is first-in-first-out (enqueue/dequeue). Depth-first search uses a stack or recursion; breadth-first search uses a queue and finds shortest path in unweighted graphs.

  • Dijkstra's algorithm finds single-source shortest paths on non-negative edge weights in O((V+E) log V) with a binary heap; it fails on negative weights, where Bellman-Ford (O(VE)) applies.

  • A minimum spanning tree connects all V vertices with V-1 edges and minimum total weight; Kruskal sorts edges and uses union-find, Prim grows from a start vertex using a priority queue.

  • Relational normal forms: 1NF removes repeating groups, 2NF removes partial dependencies on part of a composite key, 3NF removes transitive dependencies on non-key attributes.

  • ACID: Atomicity (all-or-nothing), Consistency (valid state transitions), Isolation (concurrent transactions do not interfere), Durability (committed data survives failure).

  • SQL joins: INNER returns matching rows only; LEFT returns all left rows plus matches; FULL returns all rows from both sides. WHERE filters rows before grouping; HAVING filters groups after GROUP BY.

  • TCP is connection-oriented with ordered, reliable delivery and flow control; UDP is connectionless with no delivery guarantee, used where latency matters more than reliability.

  • IPv4 uses 32-bit addresses; IPv6 uses 128-bit. A /24 CIDR prefix leaves 8 host bits, giving 2^8 - 2 = 254 usable addresses after network and broadcast.

  • Encoding versus encryption: Base64 is reversible encoding with no key and no secrecy; hashing (SHA-256) is one-way; symmetric encryption uses one shared key; asymmetric uses a public/private pair.

  • Public-key cryptography enables key exchange and digital signatures; TLS combines asymmetric handshake with symmetric session encryption for bulk data.

  • A digital signature is produced by hashing the message then encrypting the hash with the sender's private key; verification uses the sender's public key.

  • Agile values: working software over comprehensive documentation, responding to change over following a plan; Scrum adds timeboxed sprints, a product backlog and defined roles (product owner, scrum master, developers).

  • Kanban limits work in progress (WIP) to expose bottlenecks; Little's Law: average lead time = WIP / throughput.

  • Usability heuristics include visibility of system status, user control and freedom, consistency, error prevention, and recognition over recall.

  • Version control: a commit is a snapshot with a parent pointer; branches are movable pointers to commits; merging combines histories, and rebasing rewrites commits onto a new base.

  • A hash function for integrity must be deterministic, fast, and collision-resistant; MD5 and SHA-1 are deprecated for security use because practical collisions exist.

  • Moore's Law describes transistor count doubling roughly every two years; it is an empirical trend, not a physical law, and does not by itself imply performance doubles.

  • A finite state machine has states, transitions, an initial state and accepting states; a Turing machine adds an unbounded tape, defining computability limits such as the halting problem.

Quick reference

Digital Technologies

  • Iteration over n items with a single pass is O(n); each additional nested loop over the same n multiplies the term by n.

  • Binary search requires sorted input and halves the interval each iteration, achieving O(log n) comparisons.

  • Recursion needs a base case; each call consumes stack frame memory, so recursion depth of n uses O(n) space.

  • Choose a data structure by operation cost: array O(1) index but O(n) insert; linked list O(1) insert at head but O(n) search; hash map O(1) average lookup; heap O(1) peek minimum.

  • Breadth-first search explores level by level using a queue and returns shortest paths in unweighted graphs; depth-first search uses a stack and detects cycles.

  • Dijkstra requires non-negative weights; use Bellman-Ford when negative edges may exist, and Floyd-Warshall for all-pairs shortest paths in O(V^3).

  • A greedy algorithm is correct only when the problem has the optimal-substructure and greedy-choice properties; otherwise dynamic programming or exhaustive search is needed.

  • Memoisation caches results of repeated subproblems, converting exponential recursion into polynomial time at the cost of memory.

  • Database indexes speed reads but slow writes and consume storage; a composite index supports queries on its leading column first.

  • Normalisation to 3NF reduces redundancy and update anomalies; denormalisation trades consistency risk for read performance.

  • Transactions satisfy ACID; isolation levels trade consistency against concurrency, and lost updates and dirty reads are classic concurrency anomalies.

  • TCP guarantees ordered delivery and retransmits lost segments; UDP sends datagrams without acknowledgement, suiting streaming and DNS lookups.

  • CIDR /n leaves 2^(32-n) addresses in IPv4; subtract 2 for network and broadcast where applicable.

  • Symmetric encryption (AES) is fast and used for bulk data; asymmetric encryption (RSA, ECC) solves key distribution and signatures but is slower.

  • Hashing is one-way and used for integrity and password storage with salt; encryption is reversible with a key.

  • TLS uses asymmetric key exchange then symmetric encryption, providing confidentiality and integrity in transit.

  • Agile and Scrum are frameworks, not guarantees: sprints are timeboxed, and the retrospective drives process improvement.

  • Kanban visualises flow and limits WIP; Little's Law relates lead time, WIP and throughput.

  • Version control commits form a directed acyclic graph; branches are pointers, and rebasing rewrites history while merging preserves it.

  • A finite state machine models computation with finite states; a Turing machine models unbounded computation and its halting problem is undecidable.

Quick reference

Digital Technologies

  • Big-O describes growth rate, ignoring constants and lower-order terms: 3n^2 + 5n + 7 is O(n^2).

  • Binary search on sorted data is O(log n); linear search is O(n); sorting comparison-based data is at best O(n log n) in the worst case.

  • Hash tables give O(1) average lookup, but collisions degrade performance; balanced trees guarantee O(log n).

  • Stacks are LIFO, queues are FIFO; BFS uses a queue, DFS uses a stack, and both run in O(V+E) on adjacency lists.

  • Dijkstra works only with non-negative weights; Bellman-Ford handles negative edges; Floyd-Warshall computes all-pairs paths.

  • MST properties: V vertices require V-1 edges; Kruskal uses union-find, Prim uses a priority queue.

  • Relational keys: primary key uniquely identifies rows, foreign key references another table's primary key, and 2NF removes partial dependencies.

  • ACID: atomicity, consistency, isolation, durability; isolation levels balance concurrency against anomalies like dirty reads.

  • TCP is reliable and ordered; UDP is connectionless and unreliable but lower latency. IPv4 is 32-bit, IPv6 is 128-bit.

  • Base64 is encoding, not encryption; hashing is one-way; symmetric encryption uses one key; asymmetric uses a public/private pair.

  • Digital signatures hash the message and encrypt the hash with the sender's private key; verification uses the public key.

  • Agile values working software and responding to change; Scrum uses sprints, a product backlog and defined roles; Kanban limits WIP.

  • Usability heuristics include visibility of system status, consistency, error prevention and recognition over recall.

  • Git commits form a DAG; branches are pointers and rebasing rewrites history, while merging preserves it.

  • Moore's Law is an empirical trend of transistor doubling roughly every two years, not a physical law.

  • A finite state machine has finite states and transitions; a Turing machine adds unbounded tape, and the halting problem is undecidable.

Quick reference

Digital Technologies

  • Big-O ignores constants: 5n + 3 is O(n); nested loops multiply complexity, giving O(n^2) for two levels.

  • Binary search is O(log n) and requires sorted data; comparison sorting is O(n log n) worst case; quicksort is O(n^2) worst case.

  • Hash table average lookup is O(1); worst case O(n) with collisions; balanced trees guarantee O(log n).

  • Stacks are LIFO and queues are FIFO; BFS uses a queue and finds shortest unweighted paths; DFS uses a stack and detects cycles.

  • Dijkstra requires non-negative weights; Bellman-Ford handles negatives; Floyd-Warshall computes all-pairs shortest paths in O(V^3).

  • An MST has V-1 edges; Kruskal sorts edges and uses union-find; Prim grows from a start vertex with a priority queue.

  • Normalisation: 1NF removes repeating groups, 2NF removes partial key dependencies, 3NF removes transitive dependencies.

  • ACID: atomicity, consistency, isolation, durability; WHERE filters rows before grouping, HAVING filters groups after GROUP BY.

  • TCP is reliable and ordered; UDP is connectionless and unreliable. IPv4 is 32-bit; IPv6 is 128-bit; a /24 leaves 254 usable hosts.

  • Base64 is reversible encoding without a key; hashing is one-way; symmetric encryption uses one key; asymmetric uses a public/private pair.

  • Digital signatures hash the message and encrypt the hash with the sender's private key; the public key verifies.

  • Agile values working software and responding to change; Scrum uses timeboxed sprints and defined roles; Kanban limits WIP.

  • Usability heuristics include visibility of system status, consistency, error prevention and recognition over recall.

  • Git commits form a DAG; branches are pointers; merging preserves history while rebasing rewrites it.

  • Moore's Law is an empirical doubling of transistor count roughly every two years, not a physical law.

  • A finite state machine has finite states and transitions; a Turing machine adds unbounded tape; the halting problem is undecidable.

Quick reference

Digital Technologies

  • Big-O ignores constants and lower-order terms: 3n^2 + 5n + 7 is O(n^2); nested loops multiply, giving O(n^2) for two levels.

  • Binary search is O(log n) on sorted data; comparison sorting is O(n log n) worst case; quicksort is O(n^2) worst case; merge sort is stable.

  • Hash tables give O(1) average lookup but O(n) worst case under collisions; balanced trees guarantee O(log n).

  • Stacks are LIFO and queues are FIFO; BFS uses a queue and finds shortest unweighted paths; DFS uses a stack and detects cycles.

  • Dijkstra requires non-negative weights; Bellman-Ford handles negatives; Floyd-Warshall computes all-pairs shortest paths in O(V^3).

  • An MST has V-1 edges; Kruskal sorts edges and uses union-find; Prim grows from a start vertex with a priority queue.

  • Normalisation: 1NF removes repeating groups, 2NF removes partial key dependencies, 3NF removes transitive dependencies.

  • ACID: atomicity, consistency, isolation, durability; WHERE filters rows before grouping, HAVING filters groups after GROUP BY.

  • TCP is reliable and ordered; UDP is connectionless and unreliable. IPv4 is 32-bit; IPv6 is 128-bit; a /24 leaves 254 usable hosts.

  • Base64 is reversible encoding without a key; hashing is one-way; symmetric encryption uses one key; asymmetric uses a public/private pair.

  • Digital signatures hash the message and encrypt the hash with the sender's private key; the public key verifies.

  • Agile values working software and responding to change; Scrum uses timeboxed sprints and defined roles; Kanban limits WIP.

  • Usability heuristics include visibility of system status, consistency, error prevention and recognition over recall.

  • Git commits form a DAG; branches are pointers; merging preserves history while rebasing rewrites it.

  • Moore's Law is an empirical doubling of transistor count roughly every two years, not a physical law.

  • A finite state machine has finite states and transitions; a Turing machine adds unbounded tape; the halting problem is undecidable.

Quick reference

Digital Technologies

  • Big-O ignores constants and lower-order terms: 3n^2 + 5n + 7 is O(n^2); nested loops multiply, giving O(n^2) for two levels.

  • Binary search is O(log n) on sorted data; comparison sorting is O(n log n) worst case; quicksort is O(n^2) worst case; merge sort is stable.

  • Hash tables give O(1) average lookup but O(n) worst case under collisions; balanced trees guarantee O(log n).

  • Stacks are LIFO and queues are FIFO; BFS uses a queue and finds shortest unweighted paths; DFS uses a stack and detects cycles.

  • Dijkstra requires non-negative weights; Bellman-Ford handles negatives; Floyd-Warshall computes all-pairs shortest paths in O(V^3).

  • An MST has V-1 edges; Kruskal sorts edges and uses union-find; Prim grows from a start vertex with a priority queue.

  • Normalisation: 1NF removes repeating groups, 2NF removes partial key dependencies, 3NF removes transitive dependencies.

  • ACID: atomicity, consistency, isolation, durability; WHERE filters rows before grouping, HAVING filters groups after GROUP BY.

  • TCP is reliable and ordered; UDP is connectionless and unreliable. IPv4 is 32-bit; IPv6 is 128-bit; a /24 leaves 254 usable hosts.

  • Base64 is reversible encoding without a key; hashing is one-way; symmetric encryption uses one key; asymmetric uses a public/private pair.

  • Digital signatures hash the message and encrypt the hash with the sender's private key; the public key verifies.

  • Agile values working software and responding to change; Scrum uses timeboxed sprints and defined roles; Kanban limits WIP.

  • Usability heuristics include visibility of system status, consistency, error prevention and recognition over recall.

  • Git commits form a DAG; branches are pointers; merging preserves history while rebasing rewrites it.

  • Moore's Law is an empirical doubling of transistor count roughly every two years, not a physical law.

  • A finite state machine has finite states and transitions; a Turing machine adds unbounded tape; the halting problem is undecidable.