Time complexity of Math.Sqrt()?

前端 未结 1 1153
情深已故
情深已故 2021-01-18 00:19

How can I find the complexity of this function?

private double EuclideanDistance(MFCC.MFCCFrame vec1, MFCC.MFCCFrame vec2)
{
  double Distance = 0.0;
  for (         


        
相关标签:
1条回答
  • 2021-01-18 01:13

    You can consider it O(1):

    In other words, Math.Sqrt() translates to a single floating point machine code instruction

    source: c# Math.Sqrt Implementation

    0 讨论(0)
提交回复
热议问题