Question: how to find the time complexity of an algorithm?
Answer: For example Selection sort and Insertion Sort have O(n^2) time complexity. O(Logn) Time Complexity of a loop is considered as O(Logn) if the loop variables is divided / multiplied by a constant amount. For example Binary Search has O(Logn) time complexity.