C ++ code to reorder an array according to given indices
#include <bits/stdc++.h> NEW_LINE using namespace std ; int heapSize ; void swap ( int & a , int & b ) { int temp = a ; a = b ; b = temp ; } void heapify ( int arr [ ] , int index [ ] , int i ) { int largest = i ;