Repository navigation
Description
Describe the Issue
-
Big O is conflated with worst-case and tight growth
- **Big O Notation**: Describes the worst-case performance, or growth rate, of an algorithm as the input size increases. It focuses on how resource usage grows with input size, ignoring constant factors and lower-order terms.- **O(log n) - Logarithmic Time**: Time increases slowly as input grows. Common in algorithms that repeatedly reduce problem size by a fraction (like Binary Search).- **O(n) - Linear Time**: Running time increases proportionally to input size.- **O(n²) - Quadratic Time**: Running time increases quadratically. Often seen in nested loops.The description defines Big O as worst-case performance and presents upper bounds as tight growth rates. The current lesson explicitly separates the selected case from the upper bound and distinguishes an upper bound from tight growth.
-
Quick Sort complexity omits the average-case qualification
- **O(n log n) - Log-Linear Time**: Common time complexity of efficient sorting algorithms like Merge Sort and Quick Sort.The description groups Merge Sort and Quick Sort under O(n log n) without distinguishing cases. With the preceding worst-case definition, it incorrectly suggests this is the worst-case bound for ordinary Quick Sort.
-
Set-element description incorrectly treats immutability as sufficient
- **Immutable Elements Only**: Sets can only contain immutable data types (numbers, strings, tuples) because hash values must remain constant.The description lists tuples without qualification. The earlier sets lesson explicitly explains that a tuple containing a list cannot be a set element, even though the tuple itself is immutable. The maps, hash maps, and sets lesson lists numbers and strings as allowed elements and lists, dictionaries, and other sets as disallowed elements. Neither lesson introduces hashability as a term.
-
Chaining is described as grouping equal hash values rather than equal bucket indices
- **Hash Collision**: Occurs when two different keys produce the same hash value.- **Collision Resolution Strategies**:
- **Chaining**: Each array index points to a linked list storing all elements with same hash value
- **Open Addressing**: Search for next available index using predefined sequenceIn the description of a hash table, distinct hash values can map to the same array index. The chaining bullet wrongly restricts a bucket to elements with the same hash value; the lesson correctly groups entries by the resulting index.
-
Queue example introduces an untaught API
from collections import deque # Using deque for efficient queue operations queue = deque() # Enqueue operations queue.append(1) queue.append(2) queue.append(3) # Dequeue operations first_element = queue.popleft() # Returns 1
The description introduces
collections.deque,deque(), andpopleft(). Neither the lecture block nor the linked-list workshop teaches this API. The preceding Python v9 material does not introduce thedequeimport, constructor, orpopleft()method. The source lesson teaches queue behavior without a Python implementation. -
Problem-solving description omits algorithm selection and implementation/refinement
- **Understanding the Problem**: Read the problem statement multiple times. Identify the input, expected output, and how to transform input to output.- **Edge Cases**: Specific, valid inputs that occur at the boundaries of what an algorithm should handle. Always consider and test edge cases.The description summarizes understanding, pseudocode, and edge cases, but omits comparing alternative algorithms and data structures, implementing readable modular code, and testing and refining the result. These are separate stages taught by the source lesson.
-
Static-array description omits indexed access and selection criteria
- **Static Arrays**: Have a fixed size determined at initialization. Elements stored in adjacent memory locations. Size cannot be changed during program execution.- **Dynamic Arrays**: Can grow or shrink automatically during program execution. Handle resizing through automatic copying to larger arrays when needed.The static-array bullet only covers fixed size and adjacent storage. It omits how contiguous storage supports constant-time indexed access and when to choose a static array. The final use-case list only mentions dynamic lists. The review also omits the lesson's clarification that Python has no traditional built-in static array; it already identifies Python lists as dynamic arrays.
-
Description uses ADT without explaining the abstraction
- **Map (Abstract Data Type)**: Manages collections of key-value pairs. Every key must be unique, but values can be repeated.- **Hash Map**: Concrete implementation of map ADT using hashing technique. Uses hash function to generate hash values for keys, which determine storage location in underlying array.The description labels a map an abstract data type and then abbreviates it as ADT, but omits the lesson's distinction between an interface specifying operations and an implementation specifying how they work.
-
Description omits data-structure operation space costs
- **Push Operation**: Adding an element to the top of the stack. Time complexity: O(1).- **Pop Operation**: Removing an element from the top of the stack. Time complexity: O(1).- **Enqueue Operation**: Adding an element to the back of the queue. Time complexity: O(1).- **Dequeue Operation**: Removing an element from the front of the queue. Time complexity: O(1).### Operations and Time Complexities- **Insert at beginning**: O(1)
- **Insert at end**: O(n) - must traverse to end
- **Insert in middle**: O(n) - must traverse to position
- **Delete from beginning**: O(1)
- **Delete from end**: O(n) - must traverse to find previous node
- **Delete from middle**: O(n) - must traverse to find node### Time Complexities for Hash Maps- **Average case**: O(1) for insert, get, delete
- **Worst case**: O(n) when many hash collisions occur### Time Complexities for Sets- **Average case**: O(1) for add, remove, membership testing
- **Worst case**: O(n) due to hash collisionsThe review gives time costs for these operations but none of their taught auxiliary-space costs. The general Space Complexity section does not connect those bounds to stack, queue, linked-list, hash-map, or set operations.
-
Linked-list description omits pointer updates and workshop concepts
- **Structure**: Each node has data and one reference to the next node.
- **Traversal**: Can only move forward from head to tail.
- **Head Node**: First node in the list, usually the only directly accessible node.
- **Tail Node**: Last node in the list, points to `None`.
### Operations and Time Complexities
- **Insert at beginning**: O(1)
- **Insert at end**: O(n) - must traverse to end
- **Insert in middle**: O(n) - must traverse to position
- **Delete from beginning**: O(1)
- **Delete from end**: O(n) - must traverse to find previous node
- **Delete from middle**: O(n) - must traverse to find node
- **Structure**: Each node has data and two references: next node and previous node.
- **Traversal**: Can move in both directions.
- **Memory**: Requires more memory than singly linked lists due to extra reference.
The description lists node structure, traversal direction, and time costs but does not explain insertion/deletion by rewiring references. It also omits the workshop's nested Node class, empty-list representation, length tracking, and traversal/removal implementation, and the lecture's retained tail reference for doubly linked lists.
- Set description omits pop, clear, and length complexity
# Add and remove elements
numbers.add(5)
numbers.remove(4) # Raises KeyError if not found
numbers.discard(4) # No error if not found
- **Average case**: O(1) for add, remove, membership testing
- **Worst case**: O(n) due to hash collisions
The set example only reviews add, remove, and discard. The source lesson also teaches pop() and clear(), and gives constant-time length lookup.
Affected Pages
Expected behavior
-
The Big O definition should describe an asymptotic upper bound and distinguish that bound from the choice of best, average, or worst case. Descriptions of logarithmic, linear, and quadratic growth should make clear when a bound is tight.
-
The sorting examples should distinguish Merge Sort's O(n log n) worst-case complexity from Quick Sort's O(n log n) average-case and O(n²) worst-case complexity.
-
Replace the blanket immutability requirement with the examples taught in the lessons: sets can contain numbers, strings, and tuples of numbers and strings, but cannot contain lists, dictionaries, or other sets. Clarify that a tuple containing a list cannot be a set element, even though the tuple itself is immutable.
-
The hash-table explanation should distinguish equal hash values from different hash values mapping to the same bucket index. Chaining should be described as grouping entries mapped to the same index.
-
The queue section should review the taught FIFO, enqueue, and dequeue concepts without introducing
collections.deque,deque(), orpopleft(). -
The problem-solving section should cover comparing approaches by time and space requirements, selecting data structures, implementing readable modular code with appropriate built-ins, testing examples and edge cases, and refining the solution.
-
The array section should connect contiguous storage to O(1) indexed access and explain when a known fixed number of elements suits a static array, compared with varying sizes for a dynamic array. It should note that Python has no traditional built-in static array, preserving the existing identification of Python lists as dynamic arrays.
-
The map section should explain an abstract data type as operations and properties specified independently of implementation. It should identify a hash map as one implementation of the map ADT.
-
The operation summaries should include the taught auxiliary-space costs and distinguish them from total container storage. Ordinary stack, queue, and linked-list insertion/removal operations should include their constant extra-space costs, with array-backed resizing qualified. Hash-map and set insertion should distinguish ordinary constant extra storage from possible O(n) allocation during resizing; deletion should include its constant extra-space cost.
-
The linked-list section should explain insertion and deletion through reference updates and summarize the workshop implementation: a nested
Nodeclass,nextandheadinitialized toNone, length tracking,is_empty(), forward traversal to append, and updating the head for an empty list. The removal summary should cover tracking the predecessor or updating the head, returning when the value is absent, and decrementing length only after removal. The doubly linked-list summary should explain how a retained tail reference supports reverse traversal. A small code example should support these concepts where needed. -
The set section should cover
pop()removing and returning an arbitrary element,clear()removing all elements, and O(1) length lookup withlen(), separately from collision-sensitive operations.
Activity
AnshBravo commentedon Nov 2, 2026
Please merge the commit with id
927307e if review passes