Please check what is wrong in the code

Hello @garganshul151,

Mistakes:

  1. void buildHeapOptimized(vector<int> &heap[][]){
    Explanation:
    You are passing an array and accepting a vector.

  2. void heapSort(vector &arr[][]){
    Same issue is with this.

Correct it.

now also error is coming

Hello @garganshul151,

  1. You are passing heap as an integer variable.
    You have to pass an array:
    void downHeapifyHelper(int&heap,int idx,int heapSize){

  2. void buildHeapOptimized(int &heap[][]){
    This is not how you pass the 2D arrays.
    You have to specify the number of columns.

  3. void heapSort(int &arr[][]){
    Same mistake.

It seems like if your basics are not clear.
I would suggest you to revise the section of your course that explains array as a parameter to the function.