zz from bbc
In the interest of transparency, full transcripts of the Team radio comms from the Chinese GP have now been made available. Selected quotes.
BMW: "Robert, can you get a close look at that Toyota diffuser?"
Kubica: "How about I bring some of it back with me?"
Kimi: "How many Hamiltons are there? That's the fourth one that's gone past me!"
Williams: "Kazuki. Be careful, the track's really wet now."
Nakajima: "It's okay, I'm not using the track!"
BMW: "Robert, there seems to be a problem with your nose."
Kubica: "Why does everyone have to talk about my nose?"
Ferrari: "Well, as we're not running KERS, at least we won't have any electrical problems!"
Massa: "&$%!!*$!"
McLaren: "Lewis, we're not sure about that last overtaking manoeuvre ... let Kimi past ... let Kimi past!"
Hamilton: "I already have ... several times!"
I need to follow my heart.
Apr 22, 2009
Apr 18, 2009
QUICK-SORT
Input: A(p, r)
QUICK-SORT(A, p, r){
if (p < r){
q = PARTITION(A, p, r);
QUICK-SORT(A, p, q-1);
QUICK-SORT(A, q+1, r);
}
}
Subroutine:
PARTITION(A, p, r){
i = p -1;
x = A[r];
for (j = p; j <= r-1; j++){
if (A[j] <= x){
i++;
exchange(A[i], A[j]);
}
}
exchange(A[i+1], A[r]);
return i+1;
}
Features:
1. T(n) = O(nlgn) ~ O(n2)
2. Sort in place
QUICK-SORT(A, p, r){
if (p < r){
q = PARTITION(A, p, r);
QUICK-SORT(A, p, q-1);
QUICK-SORT(A, q+1, r);
}
}
Subroutine:
PARTITION(A, p, r){
i = p -1;
x = A[r];
for (j = p; j <= r-1; j++){
if (A[j] <= x){
i++;
exchange(A[i], A[j]);
}
}
exchange(A[i+1], A[r]);
return i+1;
}
Features:
1. T(n) = O(nlgn) ~ O(n2)
2. Sort in place
Apr 15, 2009
HEAP-SORT
Input: A[]
Main Algorithm:
HEAP-SORt(A)
{
BUILD-MAX-HEAP(A);
for (int i = length[A]; i >=1; i--)
{
exchange(A[1], A[i]);
heap-size[A]--;
MAX-HEAPIFY(A, 1);
}
}
Subroutines:
BUILD-MAX-HEAP(A)
{
heap-size[A] = length[A];
for (int i = [heap-size[A]/2]; i >= 0; i--)
MAX-HEAPIFY(A, i);
}
MAX-HEAPIFY(A, i)
{
l = 2i;
r = 2i +1;
if (l <= heap-size[A] && A[l] > A[i])
largest = l;
else
largest = i;
if (r <= heap-size[A] && A[r] > A[largest])
largest = r;
if (largest != r)
{
exchange(A[i], A[largest]);
MAX-HEAPIFY(A, largest);
}
}
Main Algorithm:
HEAP-SORt(A)
{
BUILD-MAX-HEAP(A);
for (int i = length[A]; i >=1; i--)
{
exchange(A[1], A[i]);
heap-size[A]--;
MAX-HEAPIFY(A, 1);
}
}
Subroutines:
BUILD-MAX-HEAP(A)
{
heap-size[A] = length[A];
for (int i = [heap-size[A]/2]; i >= 0; i--)
MAX-HEAPIFY(A, i);
}
MAX-HEAPIFY(A, i)
{
l = 2i;
r = 2i +1;
if (l <= heap-size[A] && A[l] > A[i])
largest = l;
else
largest = i;
if (r <= heap-size[A] && A[r] > A[largest])
largest = r;
if (largest != r)
{
exchange(A[i], A[largest]);
MAX-HEAPIFY(A, largest);
}
}
Apr 10, 2009
Bubble Sort
Input: A[]
for (i = 1; i <= length[A]; i++)
    {
         for (j = length[A]; j >=i; j--)
           {
              if (A[j] < A[j-1])
                   Exchange (A[j], A[j -1]);
           }
     }
Features:
1. Stable
for (i = 1; i <= length[A]; i++)
    {
         for (j = length[A]; j >=i; j--)
           {
              if (A[j] < A[j-1])
                   Exchange (A[j], A[j -1]);
           }
     }
Features:
1. Stable
Apr 9, 2009
Merge Sort
Input: A[], p, r, where p < r.
Merge-Sort(A, p, r)
{
if ( p < r )
{
q = [(p + r)/2];
Merge-Sort(A, p, q);
Merge-Sort(A, q, r);
Merge(A, p, q, r);
}
}
Megre(A, p, q, r)
{
n1 = q - p + 1;
n2 = r - q;
for (i = 0; i <= n1; i++)
L[i] = A [p+i];
for (j = 0; j <= n2; j++)
R[j] = A[q+j];
L[n1 +1] = Sentinel;
R[n2 +1] = Sentinel;
i = j = 0;
for (k = p; k <= r; k++)
{
if (L[i] <= R[j])
{
A[k] = L[i];
i++;
}
else
{
A[k] = R[j];
j++;
}
}
}
Features:
1. loop invariant
2. stable
3. T(n) = O(nlgn)
Merge-Sort(A, p, r)
{
if ( p < r )
{
q = [(p + r)/2];
Merge-Sort(A, p, q);
Merge-Sort(A, q, r);
Merge(A, p, q, r);
}
}
Megre(A, p, q, r)
{
n1 = q - p + 1;
n2 = r - q;
for (i = 0; i <= n1; i++)
L[i] = A [p+i];
for (j = 0; j <= n2; j++)
R[j] = A[q+j];
L[n1 +1] = Sentinel;
R[n2 +1] = Sentinel;
i = j = 0;
for (k = p; k <= r; k++)
{
if (L[i] <= R[j])
{
A[k] = L[i];
i++;
}
else
{
A[k] = R[j];
j++;
}
}
}
Features:
1. loop invariant
2. stable
3. T(n) = O(nlgn)
Apr 8, 2009
Insertion Sort
Input: A[1..N], length[A]
for (j=2; j <= length[A]; j++)
{
key = A[j];
i = j-1;
while (A[i] > key && i > 0)
{
A[i+1] = A[i];
i--;
}
A[i+1] = key;
}
Features:
1. sort in place;
2. loop invariant;
3. stable sort;
for (j=2; j <= length[A]; j++)
{
key = A[j];
i = j-1;
while (A[i] > key && i > 0)
{
A[i+1] = A[i];
i--;
}
A[i+1] = key;
}
Features:
1. sort in place;
2. loop invariant;
3. stable sort;
Feb 16, 2009
Long time no update
I went home on 17th last month. Today, on 16th this month, I'm sitting in chair, working. One-month-time is quite easy to elapse before we catch its evanescent character.
This year will be a busy one, especially under current economic situation all over the world. In coming July, I will start to hunt for a job. There're merely four months left for me to get ready. These 120 days may be even shorter than spring vacation passed yet.
This period is paramount due to three reasons. The first is that job pressure requires me to acquire various knowledge on algorithms, cooperating, experiences in projects, to name just a few. The second stress comes from dissertation, including paper and master dissertation, which determine the Niubility extent of universities who give me offers. The third unsaid factor may influence my life time -- Delia. I have been being with her only for three days -- at my sister's wedding. Do you call this kind of encounter the predestined relationship? Maybe. She is now getting a driver's license at her hometown, but after that her parents will help her seek a job in Beijing, where I stay. I have known little about her habits, interests, temper, wants and likes, not even the color she favors. After she comes to my place, I will make more contacts with her and seriously consider whether asking her to be my GF or not.
From this week, from today, from current second, minute, hour, I am forced to work hard for my dreams, no matter how lazy I was. It seems a long time since I determined to do meaningful things. I have lost my passion, and now I am going to get it back.
This year will be a busy one, especially under current economic situation all over the world. In coming July, I will start to hunt for a job. There're merely four months left for me to get ready. These 120 days may be even shorter than spring vacation passed yet.
This period is paramount due to three reasons. The first is that job pressure requires me to acquire various knowledge on algorithms, cooperating, experiences in projects, to name just a few. The second stress comes from dissertation, including paper and master dissertation, which determine the Niubility extent of universities who give me offers. The third unsaid factor may influence my life time -- Delia. I have been being with her only for three days -- at my sister's wedding. Do you call this kind of encounter the predestined relationship? Maybe. She is now getting a driver's license at her hometown, but after that her parents will help her seek a job in Beijing, where I stay. I have known little about her habits, interests, temper, wants and likes, not even the color she favors. After she comes to my place, I will make more contacts with her and seriously consider whether asking her to be my GF or not.
From this week, from today, from current second, minute, hour, I am forced to work hard for my dreams, no matter how lazy I was. It seems a long time since I determined to do meaningful things. I have lost my passion, and now I am going to get it back.
Subscribe to:
Posts (Atom)