Function to return an string for the calculated complexity
| 52 | |
| 53 | // Function to return an string for the calculated complexity |
| 54 | std::string GetBigOString(BigO complexity) { |
| 55 | switch (complexity) { |
| 56 | case oN: |
| 57 | return "N"; |
| 58 | case oNSquared: |
| 59 | return "N^2"; |
| 60 | case oNCubed: |
| 61 | return "N^3"; |
| 62 | case oLogN: |
| 63 | return "lgN"; |
| 64 | case oNLogN: |
| 65 | return "NlgN"; |
| 66 | case o1: |
| 67 | return "(1)"; |
| 68 | default: |
| 69 | return "f(N)"; |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | // Find the coefficient for the high-order term in the running time, by |
| 74 | // minimizing the sum of squares of relative error, for the fitting curve |
no outgoing calls
no test coverage detected