Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Filter
Profile
Wall
Recent activity
All questions
All answers
Exams Taken
All Blogs
Recent activity by $hubham
0
answers
1
Time Complexity for an infinite loop
What is the time complexity for infinite loops Question 1 what is T(n) for this case While(1) { a=a+b; } Question 2 for this case if(1) { for i to n a=a+b } else { for i to n for j to n a=a+b } Edit 2: Compiled the code ... ); return 0; } output I get is 8 6 which means the else case is never executed hence in worst case do we have to consider the else part.
What is the time complexity for infinite loopsQuestion 1 what is T(n) for this caseWhile(1){a=a+b;} Question 2 for this caseif(1){for i to na=a+b}else{for i to nfor j to...
2.0k
views
commented
Feb 16, 2021
Algorithms
algorithms
time-complexity
asymptotic-notation
space-complexity
+
–
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register