3 ms·
Here's a real simple and practical equation: 1+2+3+4 . . . N = N(N+1)/2 This equation represents the number of edges on a complete graph with N+1 vertices or t
by hexagonc 15y ago
Here's a real simple and practical equation:
1+2+3+4 . . . N = N(N+1)/2
This equation represents the number of edges on a complete graph with N+1 vertices or the number of possible pairings given N+1 objects. Useful when estimating O(N) for certain algorithms that involve comparing an item to every other item in a set.
- eru 15y agoPlease be careful how you use big-O notation here.
- Natsu 15y agoIt's more useful if you know how to prove it: just add the series to itself written backwards, then divide by two. One of my math professors said that this and multiplying by things equal to one were among the tricks he used most often.