Javascript: Change the articles linked in the assignment of the space complexity lesson
Checks
- [X] This is not a duplicate of an existing issue (please have a look through our open issues list to make sure)
- [X] I have thoroughly read and understand The Odin Project Contributing Guide
- [X] Would you like to work on this issue?
Describe your suggestion
The two articles linked in the assignment are, in my opinion, insufficient. As per user comments on the first article, it appears to be causing confusion about whether space complexity includes the space taken up by the input as well as auxiliary space, or just the auxiliary space.
When describing example 2 in the article, the author says it has space complexity of O(n), but when discussing example 3, she cites example 2 as an iterative O(1).
The article uses Ruby, and while the syntax is not difficult to understand, it adds a small extra cognitive overheads for students in the Javascript path. An article using Js or plain pseudocode may be better.
If mods/admins like the idea I can suggest better articles, and if those article(s) are approved, I can update the lesson.
Path
Node / JS
Lesson Url
https://www.theodinproject.com/lessons/javascript-space-complexity
(Optional) Discord Name
freakzilla149
(Optional) Additional Comments
No response
Thank you for taking the time to make this suggestion. In the past I believe that we have wanted to keep the ruby and javascript lessons in sync, but maybe we should revisit this stance.
Can someone on the @TheOdinProject/ds-a team take a look at this?
Thank you for making this issue @RaihanSharif
I can see how the current link would be confusing. Before assigning you and letting you go to work on a PR though, I'd like to see what replacement link(s) you have in mind.
This issue is stale because it has had no activity for the last 30 days.
Do you still have interest in working on this @RaihanSharif ?
I do. I will post some recommended links on the github issue.
On Thu, 13 Feb 2025, 02:05 Josh Smith, @.***> wrote:
Do you still have interest in working on this @RaihanSharif https://github.com/RaihanSharif ?
— Reply to this email directly, view it on GitHub https://github.com/TheOdinProject/curriculum/issues/29254#issuecomment-2655266924, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFSOZIG4QXR2NRRYBZMGKCL2PP4WHAVCNFSM6AAAAABUMNRFTCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJVGI3DMOJSGQ . You are receiving this because you were mentioned.Message ID: @.***>
Ok, So on reflection, I think it would be best to leave the first article as is but add the below video to supplement it. The video is simpler. It explains the basics of complexity, works through a few examples, and most importantly, it's all in JavaScript.
https://www.youtube.com/watch?v=SHIg5UIfBnI
I couldn't find a high quality article or video that properly represents the discussion about auxiliary space only vs auxliary space + input space in the space complexity calculation. So for that reason, leaving the original article in there is probably for the best.
I'd also recommend the below video to complement or replace the recursion article. It nicely demonstrates why recursion can lead to high memory utilisation, with good examples and diagrams.
It also explains a few common mistakes people make when analysing complexity of code. For example, having two inputs a, b and thinking the complexity is O(2n), rather than O(a + b) or O(n^2) instead of O(a * b) etc.
https://www.youtube.com/watch?v=rHM3zWgnPVA
@JoshDevHub any further thoughts on this? Closable or different action needed?
@mao-sz I don't like the article, and I want to replace it. It doesn't sufficiently communicate the concept of auxiliary space, and some of the provided examples aren't functional code (ie. trying to run some of the provided Ruby would result in errors). That second point isn't necessarily super important in the context of the JS curriculum because I imagine learners read it as pseudocode anyway, but it bothers me (haha).
I think finding a satisfactory resource has proven difficult. A lot of content about it gets too much in the weeds. We might need to write some content in-house on it.
I don't mind the video linked above, but I don't think that just using that would be a sufficient replacement.
Sorry to butt in, as I know you wanted to work on resolving this @RaihanSharif
But rather than just replacing a link, this required a more substantial reworking of the lesson's content. I decided it'd be better to handle it myself.
Thank you for raising this issue though, and I look forward to your future contributions.