Merge k sorted arrays


i am unable to understand how to show the output in vectors,could you please tell the changes required?? and could you suggest me a way to execute the code without using vectors??

@Vibhuti0206
ā€˜output’ is a vector in your code. Vectors are very much like arrays. They offer all the functionality of arrays and much more. In order to print the contents in ā€˜output’ , use a loop.
for(int i=0;i<output.size();i++) {
cout << output[i] << " ";
}

https://ide.codingblocks.com/s/159869..i have written the code,still it is showing warnings and errors?unable to debug,modifications required?

@Vibhuti0206
You have written ā€œouputā€ instead of ā€œoutputā€ in Line No. 45.

https://ide.codingblocks.com/s/160025 still showing run time error

@Vibhuti0206
You havent allocated any memory to the 2D vector ā€˜arr’. When you push back in arr[i] , you first need to have a arr[i] . Allocate memory to the 2D vector arr of size k and that should resolve the runtime error.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.