retagged by
245 views

2 Answers

0 votes
0 votes
Since c is a constant

that means given loop iterate constant time

let us consider c=5,then 5 times

                       c=10,then 10 times

that means loop runs only constant time and constant time is nothing but O(1).
0 votes
0 votes

Hope this will help.

Given, C is a contstant.

You can take any value of c, either small or big. The loop will for that fixed c time, which makes the time complexity as O(1). If instead of Constant there is any other variable (let's say n) which is not constant then the complexity will change to O(n).

Related questions

1 votes
1 votes
1 answer
1
Nandkishor3939 asked Jan 25, 2019
253 views
Can any one please help me out in understanding how to read :f(n)=O(n^2)I am confused in :1] f(n) is the upper bound of n^22]f(n)’s upper bound is n^2Or is their any a...
1 votes
1 votes
1 answer
2
Avijit Shaw asked Dec 21, 2018
4,339 views
What is the time complexity of 'deleting any random node from a max or min heap'?
1 votes
1 votes
0 answers
4