The Most Important Algorithms
11–20 of 50 posts
Re: The Most Important Algorithms
#12Earlier quoted context omitted.
Instead of going by a checklist, try to approach it by domain: Searching; Sorting; floating point, integer computing, and bit-manipulation; numerical analysis and computation; DSP; optimization and dynamic-programming; information theoretic stuff like compression and encryption; graph theoretic algorithms; symbolic algebra; geometric and hierarchic data structures and algorithms; statistical, probabilistic and infere…
I am going through Cormen et al. with the objective of getting my feet wet but the whole process is painfully slow. I thought it would be nice to have at least some familiarity on the widely used algorithms across the globe. However, you are right on ditching programming languages with huge boot times. I am happily trying out my algorithms in Python.
Re: The Most Important Algorithms
#13Thanks for posting this, I have a bunch of algorithms to learn. :)
Instead of going by a checklist, try to approach it by domain: Searching; Sorting; floating point, integer computing, and bit-manipulation; numerical analysis and computation; DSP; optimization and dynamic-programming; information theoretic stuff like compression and encryption; graph theoretic algorithms; symbolic algebra; geometric and hierarchic data structures and algorithms; statistical, probabilistic and infere…
It gives you questions that you write programs to solve, then judges your programs against test cases. It's fantastic. The questions are difficult, but never impossible, and they drill you well on diverse algorithms, building on previously learned concepts, so that you really understand the material.
Re: The Most Important Algorithms
#141. Tree traversal. This comes up all the time, from directory walks to DOM traversal to code analysis to folds over abstract data types. It's also something that you need to know and can't always rely on having a library function for, because many things exhibit tree-like structure without actually being instances of your language's Tree data type.
2. Hashing. Obviously as a base for hashtables (which are often your dictionary data structure of choice), but also as a general technique for generating a small fingerprint from a large set of data.
3. Statistics - mean/median/mode, but also things like confidence intervals, regressions, sample sizes, how to make sure your populations unbiased, etc.. You are evaluating your product, right? Knowing how to make good inferences from data is critical, particularly since there're lots of ways you can do it wrong.
4. Sorting. This can usually be hidden behind a library function, but it's useful to understand because many other algorithms have very different (and often better) performance characteristics if the input data is kept sorted. Binary search falls into this bullet point too.
5. Data compression algorithms. Another one that you'll rarely have to directly implement, but knowing their characteristics helps you make good speed/space tradeoffs for the rest of the system.
6. Bloom filters. This is one that I never learned in school but tends to be incredibly useful when dealing with massive data sets. Oftentimes, you want to be able to quickly reject elements if they're not in a set, but don't really care about it taking a while if they are in a set (because you expect that many more elements will be outside of the set than inside it). A Bloom filter is one of the fastest, most space-efficient ways to do this.
7. Topological sort. Dependency graphs come up all the time in practical programming problems, and usually you want a way to linearize them into a list of tasks that you can perform in order. It's also a shame that many languages' standard libraries don't have a topological sort function, so oftentimes you will have to implement this one yourself.
8. Support vector machines. These are your bread & butter machine-learning classifiers, and are really nice to know when you've got a bunch of data and want to try to automate some rote classification job.
9. Physics simulations. I've found it surprising how useful my intro physics course knowledge has been. Things like vectors, position vs. velocity vs. acceleration, damped harmonic oscillators, FFTs, etc. It's most useful when building UIs and games - oftentimes, you can make a UI feel significantly more natural by adding easing functions that behave like acceleration when you ease in and frictional damping when you ease out.
10. Unification. I'm probably biased because a lot of my hobby programming is in compilers & type systems, but unification comes up all the time in compilers, and is a really general technique for equation solving.
Re: The Most Important Algorithms
#15Re: The Most Important Algorithms
#16This reads like a textbook, i.e. it's algorithms that are highly useful to CS professors and students but not necessarily to practitioners. If I had to pick a top-10 list based on my professional experience, it would be: 1. Tree traversal. This comes up all the time , from directory walks to DOM traversal to code analysis to folds over abstract data types. It's also something that you need to know and can't always re…
Re: The Most Important Algorithms
#17This reads like a textbook, i.e. it's algorithms that are highly useful to CS professors and students but not necessarily to practitioners. If I had to pick a top-10 list based on my professional experience, it would be: 1. Tree traversal. This comes up all the time , from directory walks to DOM traversal to code analysis to folds over abstract data types. It's also something that you need to know and can't always re…
Nice list. I would probably generalize #1 into graph traversal though.
I did add topological sort to the list after remembering just how many times (and for different domains!) I've had to implement one, but other graph traversal algorithms like BFS/DFS are quite useful too.
Re: The Most Important Algorithms
#18nice list I'd also nominate :
support vector machines, back prop neural net training, delaunay triangulation, floyd-warshall, kruskal's mst, newton's method, edit distance algorithm, huffman coding or something with compression (I'd vote zip), some kind of reduction algorithm and we can't forget simulated annealing
Re: The Most Important Algorithms
#19Erm... How did this list include the merge sort and heap sort, but not the quicksort?
It's not particularly quick, has horrible worst case guarantees (which, if you care to improve, would make it slower still and very complicated), and is easy to get wrong on many accounts (repeating elements; already sorted input; unlimited recursion depth).
heapsort is simpler than quicksort, and has the best worst-case complexity you can get. It's not stable, but then neither are most quicksorts.
quicksort has its place, but it gets a lot more attention than it deserves.
Re: The Most Important Algorithms
#20Earlier quoted context omitted.
That's my usual approach, so the algorithms outside the domains I've studied were unfamiliar. Would you be able to recommend books in graph theory, and statistics/probability? I'd be much obliged.
this is a splendid book that covers the most probabilistic/statistical algorithms: http://www.inference.phy.cam.ac.uk/mackay/itila/