Home > Blockchain >  What time complexity does this graph represent?
What time complexity does this graph represent?

Time:05-24

I was trying to find the amortized time complexity of my algorithm ,but when I exported the data to a csv file and drew a graph this is what I came up with. I am trying to achieve an amortized time complexity of O(logn) ,but this clearly isn't the case. What time complexity is this?

enter image description here

CodePudding user response:

What time complexity is this?

Without sharing your data or algorithm, it's hard to say anything for sure, but based on the picture alone it looks like O(n2) to me.

Your graph plots the function S(n) = T(n) / n and the tops of the peaks look roughly co-linear, so I'm going to assume that S(n) is O(n). Then T(n) = n * S(n) = n * O(n) = O(n^2).

  • Related