menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Data Science News

>

Given an (...
source image

Medium

1w

read

148

img
dot

Image Credit: Medium

Given an (Simple) Algorithm, What it’s Time Complexity?

  • The first algorithm analyzed has a time complexity of O(N^2) due to N x N steps.
  • The second algorithm's time complexity is determined to be O(N^2) through mathematical calculations involving summations.
  • The third algorithm's time complexity is found to be O(N log(N)) based on the multiplication by 2 for each while iteration.
  • The fourth algorithm's time complexity is revealed to be O(N) as the geometric series converges to 2.

Read Full Article

like

8 Likes

For uninterrupted reading, download the app