We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Okay! If there will be a loop, it will continue till the index reaches 101 from 0 but if no loop is there it will depend on the size. So its of order O(1) for looped one and O(n) for non looped. Now am I correct?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Cycle Detection
You are viewing a single comment's thread. Return to all comments →
Okay! If there will be a loop, it will continue till the index reaches 101 from 0 but if no loop is there it will depend on the size. So its of order O(1) for looped one and O(n) for non looped. Now am I correct?