In this we will understand about basic concepts needed to deal with "Data Structures and Algorithms"
Complexity measurement:
- O(1) - Constant time - if the Computational effort remains same/constant with different input data. This can imply that number of operations being performed remain the same.
- O(n) - Linear time - if the Computational effort remains proportional with different input data. This is an acceptable Complexity. In popular Graph representation where we see comparison of various Complexities with input/data size on horizontal (x axis) and effort on vertical (y axis), O(n) complexity will be 45 °degree line. Single loop operation
- O(n^2) - n square - Quadratic time - Multiple/Nested loop operation - viewed a very bad and should be avoid if we can because of the effort/complexity of resource usage
- Logarithmic
- Auxiliary Space Complexity - Memory needed to run a program without counting the memory needed to store the input
No comments:
Post a Comment