What is the time complexity of below function? Time complexity of above function can be written as 1k + 2k + 3k + … n1k. Let us try few examples: k=1 Sum = 1 + 2 + 3 ... n = n(n+1)/2 = n2 + n/2 k=2 Sum = 12 + 22 + 32 +… Read More »
The post Time Complexity of Loop with Powers appeared first on GeeksforGeeks.