Skip to content

Instantly share code, notes, and snippets.

@ArchTaqi
Created March 27, 2022 21:20
Show Gist options
  • Save ArchTaqi/c62f7ac33bf6b75155804616e3ce4030 to your computer and use it in GitHub Desktop.
Save ArchTaqi/c62f7ac33bf6b75155804616e3ce4030 to your computer and use it in GitHub Desktop.
Codora Internship Program Assessment

If an Algorithm contains 3 loops inside, with time complexities O(n), O(n2) and O(n). What will be the the total time complexity?

for (int i = 1; i <= n; i++)  {
// code   
}    

for (int i = 1; i <= n; i++) {        
    for (int j = 1; j <= n; j++) {           
    // code
    } 
}    

for (int i = 1; i <= n; i++)  {        
// code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment