Big-O complexity for n + n-1 + n-2 + n-3 + (…) + 1
The famous mathematician Gauss is said to have found a formula for that exact problem when he was in primary school. And as mentioned by @Henry in the comments it is: Source: Wikipedia (DE), Wikipedia (EN) As work is done for every entry, i.e., O(1) is required for each “item”. Hence, the problem is in … Read more