curriculum icon indicating copy to clipboard operation
curriculum copied to clipboard

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

Open RaihanSharif opened this issue 1 year ago • 9 comments

Checks

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

RaihanSharif avatar Dec 30 '24 18:12 RaihanSharif

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?

rlmoser99 avatar Dec 31 '24 02:12 rlmoser99

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.

JoshDevHub avatar Jan 13 '25 19:01 JoshDevHub

This issue is stale because it has had no activity for the last 30 days.

github-actions[bot] avatar Feb 13 '25 02:02 github-actions[bot]

Do you still have interest in working on this @RaihanSharif ?

JoshDevHub avatar Feb 13 '25 02:02 JoshDevHub

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: @.***>

RaihanSharif avatar Feb 13 '25 08:02 RaihanSharif

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

RaihanSharif avatar Feb 13 '25 09:02 RaihanSharif

@JoshDevHub any further thoughts on this? Closable or different action needed?

mao-sz avatar Sep 13 '25 20:09 mao-sz

@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.

JoshDevHub avatar Sep 16 '25 19:09 JoshDevHub

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.

JoshDevHub avatar Nov 26 '25 18:11 JoshDevHub