For Example: N Cards are placed, if you flip a card, the next card will get reversed. If we move left to right, how much time will it take to get all cards reversed- question based on time complexity?
AnswerBot
1y
To reverse N cards, time complexity is O(N).
The time complexity to reverse N cards is O(N).
The algorithm needs to flip each card once, so the time complexity is linear.
The time it takes to reverse all...read more
Help your peers!
Add answer anonymously...
Top Phenom Software Engineer interview questions & answers
Popular interview questions of Software Engineer
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app