Time complexity

 Time complexity is not the time taken by a computer. It is a function that gives a relationship about time will (grows) increase as increase the input.

Notation:

  1. Big o notation : f(x) < = g(x)
  2. little big o nation : f(x) < g(x)  [strictly]
  3. big omega notation : f(x) >= g(x)
  4. little big omega notation: f(x) > g(x) [strictly]
  5. big theta notation: g(x) < f(x) <g(x)
       if f(x) = 3x+2, g(x) = n

Space complexity :  actual space(input) + auxiliary space (extra space)

SC for recursive function= height of the tree (path)
because all the same level functions do not come in that stack at the same time.

Comments

Popular posts from this blog

Intellect Interview Experience

Google

Accolite digital Interview experience