I need to know the Big O time of my binary heap code and if there are improvements
<p>I need to know what the Big O time of my binary heap code is, and how can I improve it?</p>

<p>Here's the code:</p>

<pre><code>public static void CreateMaxHeap(int[] a)
{
    for (int heapsize = 0; heapsize &lt; a.Length; heapsize++)
    {
        int n, p;
        n = heapsize;
        while (n &gt; 0)
        {
            p = (n - 1) / 2;
            if(a[n]&gt;a[p])
                Swap(a,n,p);
            n = p;
        }
    }
} // end of create heap
</code></pre>
