Driver Code
static void Main ( ) { int [ ] arr = { 50 , 40 , 70 , 60 , 90 } ; int [ ] index = { 3 , 0 , 4 , 1 , 2 } ; int n = arr . Length ; heapSize = n ; heapSort ( arr , index , n ) ; Console . WriteLine ( " Reordered ▁ array ▁ is : ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) Console . Write ( arr [ i ] + " ▁ " ) ; Console . WriteLine ( ) ; Console . WriteLine ( " Modified ▁ Index ▁ array ▁ is : ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) Console . Write ( index [ i ] + " ▁ " ) ; } }