Skip to main content

Posts

Showing posts with the label Space complexity

Time & Space Complexity | Time & Space Complexity in java and DSA | (Lecture 8 )

Java - Introduction to Programming Lecture 8 Time & Space Complexity Time complexity of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the length of the input.   Types of notations  :- 1. O-notation: It is used to denote asymptotic upper bound. For a given function g(n), we denote it by O(g(n)). Pronounced as “big-oh of g of n”. It is also known as worst case time complexity as it denotes the upper bound in which the algorithm terminates.   2. Ω-notation: It is used to denote asymptotic lower bound. For a given function g(n), we denote it by Ω(g(n)). Pronounced as “big-omega of g of n”. It is also known as best case time complexity as it denotes the lower bound in which the algorithm terminates.   3. 𝚯-notation: It is used to denote the average time of a program.   Examples :  Linear Time Complexity. O(n)   Comparison of functions on the basis of time complexity   It follows the following order in...