49 points · by _4bcr · 7y ago · 40 comments
Take just the first section. It talks about a bubble sort of ints. Then provides code for bubble sorting strings [1]. Then talks about "sign position in the ASCII table". "linking to the native sort function" is... not the right term (what happened to "call"?). And then we suddenly talk about "the element to be found" (weren't we just sorting?). The rest of the article is in the same vein.
I hope I'm not coming across as just picking on someone's English skills - even with perfect English I would find it hard to follow the train of thought.
[1] This is subtly different because (naive) string comparison is not constant-time, unlike comparing ints in most languages. I was half expecting the article to go there but it didn't.
PS: If not for the discussion here, I would've skipped the read because the site has no HTTPS. Please get a cert, it's free: https://letsencrypt.org/
No, the time required for linear search does not grow exponentially. It doesn't even grow quadratically. It grows linearly.
If you let M=log N, then binary search is O(M) and linear search is O(e^(log N)) = O(e^M). So viewed that way, it's O(M) vs. O(e^M), an exponential relationship.
But the blog would still not be 100% right because it adds a qualifier. It says "grows exponentiality with the size of the dataset".
Someone might say, for example, "The party was already getting out of hand, but then my roommate's drinking buddies showed up and that's when things got exponentially worse."
I should provide some background. I don’t have any education in CS. This is an antempt on my behalf to fill gaps of knowledge. Being a junior frontend dev they are plenty, and I am thankful for your criticism (thanks again! You’ll make me better).
Anyway, I have changed the blog post! Mostly by erasing text. But if there are no good, clear red thread this is the best way. :) Thanks again!
I say this because we have interviewed nearly 150 front-end candidates and had to reject all but one due to their lack of very basic algorithm/data structure skills. I encourage anything that makes that pool less depressing!
But CS as a career boost is very instrumental. I think it's better to focus on the good parts:
a) CS is fascinating, b) I also think there is an ethical side of CS. For each year, more 'logic' ends up in the frontend - I think. If this is true, there is an ethical dimension to it; not everyone have a new computer with the latest browser - performance has a ethical dimension.
Also, I for one hates when web sites are slow (so I guess there also is a business/economical side as well). But my main point is that - and no, I am not saying you're guilty of this, you clearly like CS (why comment otherwise), but the reasons you provide would gain from adding the perspective I am trying to provide, I think - is that CS should be studied because it is important, and fascinating. :)
I will never be good with CS. But if my own take on CS were only instrumental (career boost), I would most likely end up with less knowledge in comparison with reasons related to fascination (and ethics). I think this is an important point. Sure, it is perhaps made often. But in that case, I think it is important to repeat it. I see ads for many CS courses on i.e. Udemy with titles like CS for interviews and so on. I am not saying those course are bad (don't know); all I am saying is this is an instrumental view and that we (developers as a community) sometimes should be better at finding the right reasons.
Sorry, this was a long reply. :( :)
These were featured at QCon last June by one of their authors. Really great work.
https://ai.googleblog.com/2006/06/extra-extra-read-all-about...
Which reminds me just how young the field of computer science is and how even the ^well known^, fundamental algorithms might have buggy implementations.
They all submitted their implementation of binary search and he modelled them each in TLA+. The majority of them all had errors.
Popular problem with using unsigned : Write a reverse for loop from n (exclusive) to 0 (inclusive). See if you can do it without discarding your two most intuitive (but wrong) approaches.
Eh...what? Linear = Exponential growth?
I don't this is quite true.
[1]: https://www.topcoder.com/community/competitive-programming/t...
Yes, you should get a certificate for your site, yes there is room for improvement for your english and yes you have a long long way to go to just get a grasp of CS fundamentals.
But don't stop trying man. You just inspired me :)
let mid = Math.floor((low + high) / 2);
I don't know if JS has the same problem with overflow, but seeing that expression always reminds me of https://news.ycombinator.com/item?id=14906429It's simple enough to be attempted with a limited knowledge of Dafny, but subtle enough that you will need to think about what you are doing