max_heapify(a,n,i)

largest=i;

temp=-1;

while(lagest<=n)

   then l=2*largest;

           r=2*largest+1;

          if(l<=n and a[l]>a[largest])

             then largest=l;

          if(r<=n and a[r]>a[largest])

            then largest=r;

          if(largest!=temp)

           then a[laegest]<->a[temp];

         else

            break;

相关文章:

  • 2022-01-25
  • 2022-01-17
  • 2021-05-20
  • 2022-12-23
  • 2021-12-13
  • 2021-11-25
猜你喜欢
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2022-12-23
  • 2021-05-27
  • 2022-12-23
相关资源
相似解决方案