learn.upgrad.com/course/2041/segment/17184/106924/323351/1678995
1 Users
0 Comments
10 Highlights
0 Notes
Tags
Top Highlights
What would be the time complexity of the following code?
In the given code there is a for loop in addition to a recursion.
e time complexity of for loop would be
For the recursive call, the stopping condition is n<=0.
time complexity of the function will become
What would be the time complexity of the following code?
In the given code, the stopping condition is n<=0.
function is calling itself twice
time complexity of both the recursive calls would be O ( n )
Due to two recursive calls on every recursion, the time complexity of the code will be
Glasp is a social web highlighter that people can highlight and organize quotes and thoughts from the web, and access other like-minded people’s learning.