if(heaparray[ !nullsystem out printheaparray[midata ")else system out print"-")system out println()/heap format int nblanks int itemsperrow int column int /current item string dots "system out println(dots+dots)/dotted top line while(currentsize if(column = for(int = <nblanksk++system out print(')/for each heap item /first item in row/preceding blanks /display item system out print(heaparray[jidata)if(++ =currentsizebreak/doneif(++column==itemsperrow/end of rownblanks / /half the blanks itemsperrow * /twice the items column /start over on system out println()/new row else /next item on row for(int = <nblanks* - ++system out print(')/interim blanks /end for system out println("\ "+dots+dots)/dotted bottom line /end displayheap(//end class heap ///////////////////////////////////////////////////////////////class heapapp public static void main(string[argsthrows ioexception int valuevalue heap theheap new heap( )/make heapmax size boolean success