Earlier quoted context omitted.
What percentage would you say are clueless about CS101 basic things?
I would estimate 75% of Web developers are "clueless" about algorithms and data structures (although that's a fairly strong word).
Algorithms.js – Atwood's Law applied to CS101
21–30 of 36 posts
Re: Algorithms.js – Atwood's Law applied to CS101
#22Re: Algorithms.js – Atwood's Law applied to CS101
#23Re: Algorithms.js – Atwood's Law applied to CS101
#24Earlier quoted context omitted.
What percentage would you say are clueless about CS101 basic things?
I would estimate 75% of Web developers are "clueless" about algorithms and data structures (although that's a fairly strong word).
Re: Algorithms.js – Atwood's Law applied to CS101
#25Why not try to implement the iterative O(ln(n)) Fibonacci from SICP (Ex 1.19), rather than the old O(n) one? Or the Matrix exponentiation solution (he'd probably want to implement iterative matrix exponentiation too... doesn't look like he knows clearly how to do this)? https://en.wikipedia.org/wiki/Fibonacci_number#Matrix_form
Considering that the Fibonacci sequence is exponential, and hence the Nth Fibonacci number contains O(n) digits (well, in any sane base at least), you cannot compute the Nth Fibonacci number in under O(n) time.
The javascript solution presented does everything in O(n) arithmetic operations, and the SICP way does it in O(ln(n)) arithmetic operations (actually, there are a lot of ways to do it in O(ln(n)) operations).
Re: Algorithms.js – Atwood's Law applied to CS101
#26Earlier quoted context omitted.
I would estimate 75% of Web developers are "clueless" about algorithms and data structures (although that's a fairly strong word).
This seems high...I just went through a bunch of front end web developer interviews and nearly everyone I was asked some algorithm or data structure question. Maybe it's just NYC or maybe it's where I was applying.
Re: Algorithms.js – Atwood's Law applied to CS101
#27Earlier quoted context omitted.
There are a couple of GCD algorithms that have better asymptotic performance than Euclid's (an old one is due to Knuth): http://www.ams.org/journals/mcom/2008-77-261/S0025-5718-07-0... I'm surprised the author didn't implement the binary gcd, however, although it has the same big-O as Euclid: https://en.wikipedia.org/wiki/Binary_GCD_algorithm
I've been doing this sporadically and in my free time, just for fun, so there are a lot of fundamental things that haven't been covered there. :)
Re: Algorithms.js – Atwood's Law applied to CS101
#28Why is this even on hn? Are you kidding me? I have some college projects too you know...
Re: Algorithms.js – Atwood's Law applied to CS101
#29Earlier quoted context omitted.
Considering that the Fibonacci sequence is exponential, and hence the Nth Fibonacci number contains O(n) digits (well, in any sane base at least), you cannot compute the Nth Fibonacci number in under O(n) time.
Given the guys programming in Javascript and not using arbitrary precision arithmetic, he's always using 64 bits and representing his numbers as floating point, so I don't think you are reasoning correctly about the asympototic complexity here. I mean, if you really want to argue this, then to quote Leibniz: "Calculemus!" The javascript solution presented does everything in O(n) arithmetic operations, and the SICP wa…
Re: Algorithms.js – Atwood's Law applied to CS101
#30Earlier quoted context omitted.
This seems high...I just went through a bunch of front end web developer interviews and nearly everyone I was asked some algorithm or data structure question. Maybe it's just NYC or maybe it's where I was applying.
It's likely an artifact of the jobs you're applying for but also consider that they're might be asking those questions now because in the past there were too many applicants who weren't qualified. It's only been fairly recently that front-end development has been taken more seriously as an engineering discipline.