3 ms·
Knowing the bubblesort is useful because it is the naive solution and isn't that great, so it leads you to dig for better options.
by schwede 10y ago
Knowing the bubblesort is useful because it is the naive solution and isn't that great, so it leads you to dig for better options.
- chii 10y agoMore often than not, the sort function of the tech stack you use is the"best" already. Unless you're doing stuff at the peta scale, knowing bubble sort or not isn't going to be instrumental in the success of the project.
- khedoros1 10y agoBubblesort's a great learning tool, though. Knowing the implementation of bubblesort is like knowing my base-10 multiplication tables. In a realistic case, I'll use sort(), just like I'll use a calculator for any multiplication over a couple digits. Still, coding the algorithm (and some others for comparison) in class and seeing the practical differences in performance is a wonderful illustration of why algorithms have to be chosen carefully. Will it help in this project (or any other)? Almost impossible. But it provides a nice jumping off point during education, and really, you're not likely to actually forget it, right?
- christianmann 10y agoAlso bubblesort is sometimes the best solution, for instance in very small lists or linked lists.