ADHD-Friendly β’ All Questions + Answers from Review Slides β’ Spring 2026
Discuss the differences between recursive and iterative solutions for Fibonacci in terms of time complexity.
Uses a loop. Calculates each number once. Linear time β scales well.
Calls itself twice at each step. Exponential time β gets incredibly slow fast!
The diagram shows nodes with arrows going both directions and the last node connects back to the first.
| Type | Direction | Last β First? | Real Use |
|---|---|---|---|
| Singly Linked | One way β | No | Simple lists |
| Circular Singly | One way β | Yes β© | Chess game turns |
| Doubly Linked | Both β | No | Music player (fwd/back) |
| Circular Doubly | Both β | Yes β© | Mac app switcher (β+Tab) |
Every parent is smaller than its children. The root = smallest element.
Every parent is larger than its children. The root = largest element.
When two keys collide, create a linked list at that slot. All colliding values go into the same chain.
Think: each table slot is a bucket with a chain hanging from it
If a slot is full, move to the next available slot (decrease index by 1). Wraps around to the end if needed.
Problem: "clustering" β slots fill up in groups, slowing things down
Apply linear probing: if the target slot is taken, keep decrementing the index until you find an empty slot. Apply chaining: if the slot is taken, add to the linked list at that position.
| Rule | Result | Carry |
|---|---|---|
| 0 + 0 | 0 | 0 |
| 0 + 1 or 1 + 0 | 1 | 0 |
| 1 + 1 | 0 | 1 |
| 1 + 1 + 1 (with carry) | 1 | 1 |
11011.101Group bits in sets of 4 from the decimal point outward
Integer: 0001 1011 β 1B
Fraction: .1010 β .A
Group bits in sets of 3 from the decimal point outward
Integer: 011 011 β 33
Fraction: .101 β .5
0100000111011101, pad to 23 bits with zeros0 | 10000011 | 10111010000000000000000Simply flip every bit: 0β1 and 1β0
11011.101 β 00100.010
The circuit diagram shows: A & B feed into an AND gate, B & C feed into an OR gate, then that feeds into an AND gate, and both AND results feed into a final OR gate.
Q = AB + BC
Read the circuit: AND gate gives AΒ·B, the ORβAND path gives BΒ·C, and the final OR gate combines them.
| Gate | Symbol | Rule |
|---|---|---|
| AND | Β· | Output 1 only if ALL inputs are 1 |
| OR | + | Output 1 if ANY input is 1 |
| NOT | A' | Flips the input |
| NAND | (AΒ·B)' | AND then NOT |
| NOR | (A+B)' | OR then NOT |
| XOR | β | Output 1 if inputs are DIFFERENT |
Decode: 01001110 01101111 00100001
01001110 β decimal 78 β N01101111 β decimal 111 β o00100001 β decimal 33 β !Answer: "No!"
(The slide confirms this β it literally says "No!" π)
Vocabulary: [The, cat, in, hat, sat, on, mat]
β’ "The cat in the hat" β [2, 1, 1, 1, 0, 0, 0]
β’ "The cat sat on the mat" β [2, 1, 0, 0, 1, 1, 1]
| Word | human | animal | world | computer |
|---|---|---|---|---|
| human | 1 | 0 | 0 | 0 |
| animal | 0 | 1 | 0 | 0 |
| world | 0 | 0 | 1 | 0 |
| computer | 0 | 0 | 0 | 1 |
Sets: A = Americans, M = Mathematicians, P = Philosophers, Knows = relation where (x,y) means x knows y
Οβ(Knows β (A β© M))
Plain English: Find all x where there exists a y such that (x Knows y) AND y is in A AND y is in M
P β Οβ(Knows β M')
Plain English: Start with all philosophers, remove any who know at least one non-mathematician
Simplify: ((A β B) β© A) β B
| Law | Formula |
|---|---|
| Implication | A β B = A' βͺ B |
| De Morgan (β©) | (A β© B)' = A' βͺ B' |
| De Morgan (βͺ) | (A βͺ B)' = A' β© B' |
| Complement | A β© A' = β | A βͺ A' = U |
| Identity | A βͺ β = A | A β© U = A |
| Absorption | A β© (A βͺ B) = A |
| Abjunction | (A β B)' = A β© B' |
Use Pythagorean theorem:
|z| = β(realΒ² + imaginaryΒ²)
|z| = β(2Β² + 3Β²)
|z| = β(4 + 9) = β13
Use arctangent:
ΞΈ = arctan(imaginary / real)
ΞΈ = arctan(3/2)
π Fibonacci: Iterative = O(n), Recursive = O(2βΏ)
π List type: Circular Doubly Linked List
π² Heap: Min = smallest at root, Max = largest at root
ποΈ Collision fix: Chaining = linked lists, Probing = find next empty slot
π ASCII decode: "No!" (binary β decimal β letter)
π 1's Complement: Just flip all bits!
π IEEE 754: Sign | Exponent+127 | Mantissa (23 bits)
β‘ Logic gates: Q = AB + BC
π¦ One-hot: One "1" per row, rest are "0"s
π Fourier: Loop β complex sine wave β dot product