{"id":446,"date":"2021-04-27T19:00:00","date_gmt":"2021-04-27T18:00:00","guid":{"rendered":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/lidia-andre\/?p=446"},"modified":"2022-01-24T13:33:46","modified_gmt":"2022-01-24T13:33:46","slug":"time-complexity-whats-that","status":"publish","type":"post","link":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/lidia-andre\/2021\/04\/27\/time-complexity-whats-that\/","title":{"rendered":"How to know the Time Complexity of an Algorithm?"},"content":{"rendered":"\n

If you ever took a programming module where you had to build an algorithm to compute something, you were most probably asked about its complexity. Well, if not, it’s a good practice to check if the algorithm you wrote is efficient. No one wants to have the programme running for hours if there are faster options to achieve similar results, am I right? A common way to evaluate the complexity of a model is using Big \\mathcal{O} <\/span> notation. But what is it?<\/p>\n\n\n\n

Big \\mathcal{O}<\/span> notation is a mathematical property used to describe the asymptotic behaviour of functions. It gives us information about how fast a function grows or declines. It has many applications and one of them is to analyse the cost of algorithms.<\/p>\n\n\n\n

If you are familiar with this notation applied to programming, you may know that the most common complexities are:<\/p>\n\n\n\n