Warning: here I'm talking specifically about US copyright law, though copyright law tends to be fairly consistent internationally as well (there are quite a few international treaties about copyrights).
Copyright covers the expression of an idea, such as a written description of an algorithm or an implementation of an algorithm. IOW, the web page you looked at and the code are both (probably) covered by copyright.
A copyright cannot cover the underlying idea itself though. In this case, that would be the algorithm implemented in the code; copyrighting that simply isn't allowed.
It is possible to patent an algorithm, but patenting is a completely separate process from copyright, and the protection it gives is rather different as well.
One big difference between the two is this: copyright happens automatically. When you write something (e.g,. my typing this answer right now) it becomes copyrighted immediately by default. There are exceptions (e.g., some work that's funded by taxes automatically belongs to the tax-payers, so it's not copyrighted) but the simple rule of thumb is that copyright applies to essentially anything you write, by default.
Patents do not happen by default. To get a patent, you need to submit an application to the patent office describing your invention in sufficient detail of a person of ordinary skill in the (relevant) art to implement that idea. There are quite a few more rules, about things like what sort of invention can be patented (e.g., mathematical formulas and abstract ideas can't), and when you have to apply for the patent (soon after invention), and if you don't follow those, you're likely to lose any possibility of patenting that invention at all.
So, if you want, you can do some searching at the applicable patent office to see if somebody (possibly, but not necessarily, the author of the web page in question) has a patent on the algorithm in question. If so, that limits your ability to use that algorithm (but doesn't necessarily stop you entirely--for example, it's entirely possible to license a patent).
Assuming it's not patented, we're left with the question of copyright law. Here the standard is that a copyright covers the original expression and all "derived works". Exactly what constitutes a derived work can be difficult to determine (quite a few court cases have revolved around that exact question).
In the past, a fair number of people have use essentially the strategy you describe though: have one person (or group of people) write an abstract specification of the algorithm, then pass it (without accompanying code) to somebody who's never seen the original description of the algorithm, or the original code, and have them develop code to implement that algorithm. In a few relatively elaborate cases (e.g., when Phoenix "cloned" the original IBM PC BIOS) they had a third group of people (largely attorneys, I believe) to ensure that all the communication between the other two groups was completely "sanitary"--i.e., look at what the first group produced and ensure it didn't contain anything on which copyright could possibly be claimed before it was passed to the implementation group.