Modify an array by sorting after reversal of bits of each array element

  #include using namespace std;  int binaryToDecimal(string n){    string num = n;    int dec_value = 0;          int base = 1;      int len = num.length();    for (int i = len – 1; i >= 0; i–) {        if (num[i] == ‘1’)            dec_value += base;        base = base * 2;    }      return dec_value;}  string decimalToBinary(int n){        string binstr = “”;      while (n > 0) {                          binstr += (n % 2 + 48);        n = n / 2;    }              return binstr;}  int reversedBinaryDecimal(int N){            string decimal_to_binar        = decimalToBinary(N);              int binary_to_decimal        = binaryToDecimal(decimal_to_binar);          return binary_to_decimal;}  void printSortedArray(int arr[], int size){        sort(arr, arr + size);          for (int i = 0; i < size; i++)                  cout