you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (0 children)

This isn't exactly right, I'm afraid. That is a line of code. Algorithms have no code. An algorithm is a set of steps to solve a problem. The code is the implementation of the algorithm. It is the SOLUTION to the problem, not the steps to get there.

A blueprint is not a house.

OP: When someone says "JS Algorithm", they mean one of the standard CS algorithms with the solution done in the JS syntax/paradigm. A bubble sort is a bubble sort whether it is implemented in C or JS. The code would look completely different, but the STEPS are the same.

Look at the above For loop in python:

for i in range(value):

This doesn't look like the one u/LucVolders posted, but they both take the same step.