Apps  Contact  Seminars 

October 25th, 2014

Euclid’s Algorithm

by Amrinder Arora



October 24th, 2014

Calculating n-th power in log n time

by Amrinder Arora

Using the algorithm design technique of Divide and Conquer, we can write it easily as follows.

 
power(a,n)
{
  if n is even {
    x = power(a,n/2)
    return x * x
  }
 
   // Else
   x = power(a,(n-1)/2)
   return x*x*a
}
 

Time complexity analysis

Recurrence relation can be written as:

T(n) = T(n/2) + 1

This translates to O(log n) time

Observation

A slightly more concisely written program is a lot less efficient, and runs in O(n) time.

power(a,n)
{
  if n is even {
    return power(a,n/2) * power(a,n/2)
  }
 
   // Else
    return power(a,(n-1)/2) * power(a,(n-1)/2) * a
}

 

 


September 17th, 2014

Speaking at the Edifecs Edge Server Webinar today

by Amrinder Arora

I will be speaking at the Edifecs Edge Server Webinar today.  If you would like to register for the same, you can do so at: http://go.edifecs.com/edge-server-webinar/.



July 21st, 2014

Indonesia is in Fairfax. (At least as per Google Maps)

by Amrinder Arora

 

I got more than I bargained for when looking for Citibank branches within 5 miles of zip code 22033.

Indonesia Is Inside Fairfax

Tags: ,


May 22nd, 2014

Divide by Zero Exception, perhaps?

by Amrinder Arora
TMobile Prepaid Balance

As per TMobile’s calculation, I have 9 Gubujillion, 223 quadzillion, 372 trillion, 36 billion, 854 million, 775 thousand and 808 minutes.

Tags: