Note!– By reading this blog you can get the right answers!
The answers will be published a week after the quiz has started!
Note!– By reading this blog you can get the right answers!
The answers will be published a week after the quiz has started!
After a week again, the “You think you know … JavaScript” quiz results are on!
1. Which loop is faster in JavaScript?

Continue reading You think you know javascript. Quiz results!
Basically sorting algorithms can be divided into two main groups. Such based on comparisons and such that are not. I already posted about some of the algorithms of the first group. Insertion sort, bubble sort and Shell sort are based on the comparison model. The problem with these three algorithms is that their complexity is O(n2) so they are very slow.
So is it possible to sort a list of items by comparing their items faster than O(n2)? The answer is yes and here’s how we can do it.
The nature of those three algorithms mentioned above is that we almost compared each two items from initial list.

This, of course, is not the best approach and we don’t need to do that. Instead we can try to divide the list into smaller lists and then sort them. After sorting the smaller lists, which is supposed to be easier than sorting the entire initial list, we can try to merge the result into one sorted list. This technique is typically known as “divide and conquer”.
Normally if a problem is too difficult to solve, we can try to break it apart into smaller sub-sets of this problem and try to solve them. Then somehow we can merge the results of the solved problems.

Continue reading Computer Algorithms: Merge Sort
He always hates newest technologies and considers that pure programming with no libraries and frameworks is the masterpiece of coding and only way to show his greatness. Any mention of a library name results in something like “blah, this sucks” with no explanation why. However most often the reason is “because it’s slow” with no examples of how slow actually this library is – he does not make any performance tests at all. Always prefers to write his own pure “javascript” or “php” based code/library because he thinks this is the cutting edge of modern technology.
Always after a phone call with a client he’s angry, because “the sutpid client” doesn’t understand his way of brilliant thinking. He thinks that a project must exists just to show what a “good” developer he is and how much he knows, not because the product will be someday, somehow used by poor clients.
Bugs by other developers are always accepted with a smile with some words like “I told you”. He doesn’t think bugs will be comited if he were the developer. However bugs in his code are always accepted and explained as misconseption of the client!
Whatever solution is proposed on a meeting he’s negative. But he doesn’t propose his own solution. Typically a bad team member is always trying to say “whatever solution you get I’m telling you that there are some pitfalls”.
Because he thinks he’s the best programmer in the world, he hates going to interviews. His behaviour on interviews is always like “you know less than me and I don’t know why I’m here”. However once he gets the job he behaves with his boss like “I’m making you a favor to receive a salary from you!”
Advice: To avoid working with such jerks try to spot them on the interview. If he tells you that your choice of library and technology sucks you should better get another candidate.
1. Which is the fastest searching algorithm?

Continue reading You think you know algorithms. Quiz results!