Data Structures and Algorithms

In this we will understand about basic concepts needed to deal with "Data Structures and Algorithms"

Computational Complexity is measured is Big O notation

Complexity measurement:

  1. 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.
  2. 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
  3. 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
  4. Logarithmic
  5. Auxiliary Space Complexity - Memory needed to run a program without counting the memory needed to store the input


No comments:

Post a Comment