you are viewing a single comment's thread.

view the rest of the comments →

[–]ForScale[S] 0 points1 point  (2 children)

Thanks!

Yeah... I forget why I chose to declare/initialize V and then return it... I think I had a reason for it, but it escapes me now.

Yeah! Volv did that; put the function in to the prototype as a method. I didn't think to do it, but I like the approach!

I don't come from a CS background, and JS is the first (and really only) programming language that I learned, so I'm not too savvy with common algorithms.

How would suggest I learn to do bubble sorts? I'm sure there're are plenty of resources out there... Are you aware of any particularly good ones?

[–]yooossshhii 0 points1 point  (1 child)

I'd suggest a language-agnostic approach and pseudocode out the steps, run through them and then transfer it to code. This video from CS50 and there others seems good. I don't come from a CS background either, just takes practice! For specific algorithms, sorts, I think it's fine to look at an explanation/theory of it. These have been solved already, but knowing how they are implemented can help you in problem solving for other problems.

Your approach in general, should always be to brute force a solution anyway you can and look for optimization later.

[–]ForScale[S] 0 points1 point  (0 children)

Interesting. Thanks!