Median of Sorted Arrays

in this i have entered n=5 and after some operations my n changed to 10 automatically.
and i have initialized my array with 5 now its size is 10…does this mean that size of array can be dynamically changed at runtime???

No, the size will not change dynamically in case of static array… as if u cout the value of n after line no 16 , you will get n as 5, once you use the n in line no 21, since you j=n, so it means it would start from 5 onwards and thus after the loop, the value of n becomes 10… thus u get the output as 10.

but i am not increasing the value of n then why is it increasing…is there a concept like shallow copy and deep copy in cpp???

Yes, you have the concepts of shallow and deep copy… You can refer to the online video lecture on the same topics in your course…

https://ide.codingblocks.com/s/171553 can you explain me the output of the code it is printing 6 values

please help… not getting it

@Learning_bunny
Hello Piyush
what issue u r getting ?

@Learning_bunny
so u are trying these things
a) In array a u r reading n numbers
b) in array a1 u r rading next n numbers
c) then u are trying to add all numbers in a1 to end of array a .
d) then u r sorting

am i right ?
r u trying to do the same

@Learning_bunny
because u are not responding to the thread I am closing it.

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.