# Suppose a fair coin is tossed repeatedly until the same outcome occurs twice in a row

**15**
*Wednesday*
Apr 2015

Posted Uncategorized

in
**15**
*Wednesday*
Apr 2015

Posted Uncategorized

in
**08**
*Wednesday*
Apr 2015

Posted Uncategorized

in
**08**
*Wednesday*
Apr 2015

Posted Uncategorized

in
**07**
*Tuesday*
Apr 2015

Posted Uncategorized

in
**07**
*Tuesday*
Apr 2015

Posted Uncategorized

in
**06**
*Monday*
Apr 2015

Posted Uncategorized

inI would love to join a team of people building a product that I’m passionate about. The internship will provide invaluable production experience while still being a student. I get to work with an amazing group of Network Service developers, and learn ideas and concepts that can be used in future projects.

**06**
*Monday*
Apr 2015

Posted Uncategorized

in
**05**
*Sunday*
Apr 2015

Posted Uncategorized

in
**05**
*Sunday*
Apr 2015

Posted Uncategorized

in```
http://stackoverflow.com/questions/337664/counting-inversions-in-an-array
public static int merge(int[] a, int p, int q, int r)
{
//p=0, q=1, r=3
int countingInversion = 0;
int n1 = q-p+1;
int n2 = r-q;
int[] temp1 = new int[n1+1];
int[] temp2 = new int[n2+1];
for(int i=0; i<n1; i++) temp1[i] = a[p+i];
for(int i=0; i<n2; i++) temp2[i] = a[q+1+i];
temp1[n1] = Integer.MAX_VALUE;
temp2[n2] = Integer.MAX_VALUE;
int i = 0, j = 0;
for(int k=p; k<=r; k++)
{
if(temp1[i] <= temp2[j])
{
a[k] = temp1[i];
i++;
}
else
{
a[k] = temp2[j];
j++;
countingInversion=countingInversion+(n1-i);
}
}
return countingInversion;
}
public static void main(String[] args)
{
int[] a = {1, 20, 6, 4, 5};
int countInversion = mergeSort(a, 0, a.length-1);
System.out.println(countInversion);
}
```

**03**
*Friday*
Apr 2015

Posted Uncategorized

in