3 ms·
I put this first, because that is why I started writing this comment. I have to disagree with some of judgments made by the author. The first one is debatable b
by danbruc 13y ago
I put this first, because that is why I started writing this comment. I have to disagree with some of judgments made by the author. The first one is debatable but usually you don't want duplicates in your binary search tree - I consider all the example implementations broken. But he really lost me when he started talking about the coding style. The given example is not perfect but I consider it better then most of the other examples when it comes to coding style - if and else without braces, if with break but without else. Everywhere. It is a lot of religion, it is a lot of personal preferences, but all the more it seems really wrong to judge more on personal preferences of style than on correctness and other hard facts.
And here what should have come first. I think this is a relative unrealistic task because writing your own data structures is quite a rare task for most programming jobs. Nonetheless it is a very basic task and every professional developer should be able to get this right within 15 to 30 minutes.