simplifying algorithms by adding sentinel elements, that can be easily identified, e.g. adding $-INF$ and $+INF$ to guarantee, that a search will always find a closed interval in which the queried value would have to be. Another example is sorting, where adding elements of value $+INF$ till the number of elements reaches the next power of two allows a simpler Divide&Conquer algorithm.
Manfred Weis
- 13.2k
- 4
- 34
- 76