Skip to content

[JS v9] Data Structures Review: clarify Big O bounds, sorting cases, and auxiliary space #71691

Open

Description

@ShakilUrRehman21

Scope: JavaScript v9 Certification (review-data-structures-js). This is distinct from the Python issue #71532.

Describe the Issue

The JavaScript Data Structures Review (review-data-structures-js) contains several conceptual inaccuracies and omits topics taught in the Working with Common Data Structures JavaScript lecture:

  1. Big O conflated with worst-case performance: The text defines Big O as "worst-case performance, or growth rate". Big O is an asymptotic upper bound on resource scaling, separate from best-, average-, or worst-case scenarios.
  2. Quick Sort complexity missing case qualifications: It lists Merge Sort and Quick Sort under O(n log n) without noting that O(n log n) is Quick Sort's average case, whereas its worst case is O(n²).
  3. Missing Exponential and Factorial complexities: Omits explanations of O(2ⁿ) exponential and O(n!) factorial time and space complexities.
  4. Problem-solving methodology is incomplete: Omits algorithm/data structure selection, clean modular implementation, and testing/refinement.
  5. Static arrays lack memory indexing details and JS clarification: Omits how contiguous storage enables O(1) random access, and does not clarify that JavaScript arrays are dynamic by default.
  6. Missing auxiliary space complexities: Fails to distinguish auxiliary working memory from container storage for dynamic arrays, stacks, queues, and linked lists.
  7. Queue dequeue vs array shift: Mentions dequeue as O(1) without distinguishing abstract queue complexity from JavaScript's array .shift() O(n) re-indexing overhead.

Affected Pages

Expected behavior

  • Define Big O as an asymptotic upper bound on resource scaling.
  • Clarify Merge Sort's O(n log n) worst-case vs. Quick Sort's O(n log n) average-case and O(n²) worst-case.
  • Add O(2ⁿ) and O(n!) time and space complexity explanations.
  • Add algorithm/data structure selection and testing/refinement to problem solving.
  • Clarify contiguous memory layout and constant-time indexing for static arrays, noting JavaScript arrays are dynamic.
  • Add auxiliary space complexities for dynamic arrays, stacks, queues, and singly linked lists.
  • Clarify queue dequeue abstract O(1) time vs. array .shift() O(n) re-indexing cost.

(A fully tested PR addressing this is ready: #71620)

Activity

  1. added
    status: waiting triage
    js v9 cert
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    js v9 certstatus: waiting triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions