Thursday, July 7, 2011

Computer Science

Recursion 
Recursion is the process of repeating items in a self-similar way


For example 7! equals 7*6*5*4*3*2*1 


public int factorial(int n)
{
  if (n <= 1) 
    return 1;
  else
    return n * factorial(n-1);
}

Tail Recursion


Tail call Optimization

Thursday, June 9, 2011

Object Oriented Designs

SOLID

S = Single Responsibility Principle
O = Opened Closed Principle 
L = Liscov Substitution Principle
I = Interface Segregation Principle
D = Dependency Inversion Principle

How I explained OOD to my wife