的我试图为堆下面的代码排序即给予ArrayIndexOutOfBoundsException例外: package com.Sorting;
import java.util.Arrays;
public class HeapSort {
private static int arr[];
private static int l,r,max,hsize;
我正在尝试编写一个heapsort算法,这是我的代码。但是,它不起作用。当我尝试运行宏时,它表示下标超出范围,它对应于if A(leftchild,1) > A(i,1) then位。它说i和leftchild都等于零,但情况并非如此,但我不知道要在哪里更改它。 Sub MakeMaxHeap(i As Long, heapsize As Long)
Dim LeftChild As L