Posts

Showing posts from August, 2022

Space and Time Complexity in Detail || Java + DSA Course || Blog 13

Image
E very computer has a different processor, so algorithm can take different time to execute . So, Time complexity doesn't talk about the time taken by the algorithm. Instead, it considers how many times each statement executes. For a quick overview, we will be looking at: What is Time complexity? Solving Time complexity Big O Notation Big Omega Notation Theta Notation Little O Notation Little Omega Notation Space Complexity What is Time Complexity? Time Complexity tells us how the time is going to grow depending on its input so we can estimate value at any point. This is the Graph of Different Time complexities: Here, O(1) is constant time complexity. It means your time will remain constant at every input length. O(log n) is the time complexity used by Binary search(algorithm used to search a value in a sorted array). It starts to curve at a certain point. The more the input, the less time Taken. O(n) is the time complexity used by Linear search (algorithm used to search a value i...