---
title: "Discussion on \"Time Complexity Examples with Codes\" | Hashnode"
description: "Discussion on \"Time Complexity Examples with Codes\". 1) printf(\"Hello World\")\nThe time complextiy for above will be O(1) since it will run in constant time throughout the number of iterations therefore it is called as constant time.\n2) int val = 0;\nfor(int i = 1; i <= N; i += i){\nval++;\n}\nWe will calcu..."
url: "https://hashnode.com/posts/time-complexity-examples-with-codes/652fee9c647f1c17b62881c1"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Time Complexity Examples with Codes](https://techie2.hashnode.dev/time-complexity-examples-with-codes?utm_source=hashnode&utm_medium=feed)

1) printf("Hello World") The time complextiy for above will be O(1) since it will run in constant time throughout the number of iterations therefore it is called as constant time. 2) int val = 0; for(int i = 1; i <= N; i += i){ val++; } We will calcu...

Oct 18, 2023 · 1 min read · techie2.hashnode.dev  
Read the article

-   [#binary-search-algorithm](https://hashnode.com/tag/binary-search-algorithm)
-   [#dsa](https://hashnode.com/tag/dsa)
-   [#time-complexity](https://hashnode.com/tag/time-complexity)
-   [#coding](https://hashnode.com/tag/coding)

## Written by

[Mann Shah](https://hashnode.com/@mannshah989)

@mannshah989

  
[View profile](https://hashnode.com/@mannshah989)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
