IntroductionThere are a variety of algorithms that we rely on as software engineers on a daily basis. Below is a list of the most commonly used ones. These have mostly been taken from the wikipedia list of algorithms and augmented where neccessary. These are algorithms I have run into or relied on in the past 10 years. If I have never run into it, it didn't make the list. List of Common AlgorithmsComparisonOfAlgorithms General combinatorial algorithms- Floyd's cycle-finding algorithm: finds cycles in iterations
- Mersenne twister: PRNG
Graph algorithms- Floyd-Warshall algorithm: solves the all pairs shortest path problem in a weighted, directed graph
- Topological sort: finds linear order of nodes based on their dependencies
- Coloring algorithm: Graph coloring algorithm
- Kruskal's algorithm: find a minimum spanning tree for a graph
Search algorithms- Linear search: finds an item in an unsorted list
- Binary search: locates an item in a sorted list
- Breadth-first search: traverses a graph by level
- Depth-first search: traverses a graph branch by branch
- Hash table: finds an item in an unsorted collection in O(1) time.
String algorithmsSearching- Boyer-Moore string search algorithm: amortised linear algorithm
- Knuth-Morris-Pratt algorithm: bypasses reexamination of matched characters
Approximate matching- Levenshtein edit distance
- Metaphone: an algorithm for indexing words by their sound, when pronounced in english
- Soundex
Sorting algorithms- Bubble sort: for each pair if indices, swap the items if out of order
- Heapsort: convert the list into a heap, keep removing the largest element from the heap and adding it to the end of the list
- Insertion sort: determine where the current item belongs in the list of sorted ones and insert it there.
- Merge sort: sort the first and second half of the lists separately, then merge the sorted lists
- Quicksort: divide list into two, with all items on the first list coming before all items on the second list; then sort the two lists.
- Selection sort: pick the smallest of the remaining elements.
Compression algorithmsLossless compression algorithmsComputational geometryCryptographic algorithms- Symmetric (secret key) encryption
- Asymmetric (public key) encryption
- Cryptographic message digest functions (hashing functions)
Digital signal processing- Discrete Fourier transform
Software engineering- Cyclick redundancy check: calculation of a check word
- Parity: simple/fast error detection technique
Distributed systems algorithms- Lamport ordering: a partial ordering of events based on the happened-before relation
- Byzantine fault tolerance: good fault tolerance
Memory allocation and deallocation algorithmsOperation systems algorithms- Banker's algorithm: algorithm used for deadlock avoidance.
Process synchronisation- Lamport's bakery algorithm
Scheduling- Round-robin scheduling
- Fair-share scheduling
Machine learning algorithmsNeural networks- Backpropagation
- Self-organizing map
Number theoretic algorithms- Euclidean algorithm: generates the greatest common divisor
Numerical algorithmsOptimizing algorithms- Particle swarm
- Random-restart hill climbing
- Local search
Parsing- Recursive decent parser: a top-down parser suitable for LL(k) grammars
- LL parser: a simple linear time parsing algorithm for a limited class of context-free grammars
- LR parser: A more complex linear time parsing algorithm for a larger class of context-free grammars.
Other- Xor swap algorithm: swaps the values of two variables without using a buffer
- Stemming algorithm: a method of reducing words to their stem, base, or root form
- Hamming weight (population count): find the number of 1 bits in a binary word
|