Skip to content

Conversation

@JoshDevHub
Copy link
Contributor

Because

There are a few things that went into this.

The lesson previously included this blog post in the assignment: https://dev.to/mwong068/big-o-space-complexity-lcm

A lot of the explanation of auxiliary space was off-loaded to this post, but it has a couple of inaccuracies:

  1. It includes some Ruby code that is syntactically incorrect. A few of the shown examples can't be run.
  2. It includes some statements about space and memory use that are incorrect. A loop, for example, doesn't use O(N) extra space where its memory footprint is proportional to the size of the structure its iterating. At a low level, loops are just a set of instructions with a branch at the end that will either (1) Jump to a previous line so the preceding instructions can be repeated, or (2) Continue execution of the program, meaning the loop has ended. There may be some artifacts created (like an index) but they definitely don't have a linear relationship to the input.

This blog post has caused repeatedly caused confusion for learners (see the linked issue for one example).

There was a previous section in the lesson that included references to the different approaches one can take when counting space. I decided to merge this into the new auxiliary space section. It covered similar ground, but I also thought the way it was previously worded was a bit unfair to auxiliary space analysis. At least in my experience, it's fairly common to use it, especially when comparing two algorithms that take the same input. This can even be seen when the lesson links to the BigO cheatsheet and multiple sorting algorithms are described as taking up constant space, meaning they're definitely using an auxiliary space lens.

This PR

(All changes are made in both the Ruby and JS versions of the lesson)

  • Add section for auxiliary space analysis.
  • Add knowledge check link and lesson overview item related to the new section.
  • Remove previous #### Other considerations section and merge it with the new auxiliary space section.
  • Remove aforementioned blog post from the assignment.
  • Add stackexchange post to the Assignment
    • This was in the previous "Other considerations" section, but didn't really fit with my rearrangement of things. I think it's good to include though because it gets learners to think about how counting space is quite subjective and situation dependent.

Issue

Closes #29254

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project curriculum contributing guide
  • The title of this PR follows the location of change: brief description of change format, e.g. Intro to HTML and CSS lesson: Fix link text
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • If any lesson files are included in this PR, they follow the Layout Style Guide

@github-actions github-actions bot added Content: JavaScript Involves the JavaScript course Content: Ruby Involves the Ruby course labels Nov 26, 2025
@JoshDevHub JoshDevHub requested review from a team and CouchofTomato and removed request for a team November 26, 2025 18:55
Copy link
Contributor

@mao-sz mao-sz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave more of the content review to Austin but got a couple of nits and word flow suggestions below.
I've only attached the comments to the JS lesson diff but all of the non-code comments apply the same to the Ruby lesson of course.

@mao-sz
Copy link
Contributor

mao-sz commented Dec 2, 2025

@JoshDevHub in case you missed it in the review main comment, I have the same suggestions for the Ruby version of the lesson. I was just lazy with repeating the comments and suggestions on both files so I only stuck them on the JS one 😅

@JoshDevHub
Copy link
Contributor Author

@mao-sz Oh I know. I've just been equally lazy about going to fix them myself manually 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content: JavaScript Involves the JavaScript course Content: Ruby Involves the Ruby course

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Javascript: Change the articles linked in the assignment of the space complexity lesson

2 participants