Arrays-Linear Search

At 2:34, we see that bhaiya has not initialised the array but the code still works fine. Please explain.

hey @yajurkhurana
if you are talking about int a[1000] we can omit initializing it as we are anyways taking input for all the values in the next step

1 Like

So we don’t need to initialise if we are taking input for all the values?

you can initialize, but that wouldnt matter coz we are making sure all the values till n-1 are updated. Its a good practice to initialize though

Okay. Thanks. You may close the doubt now.

1 Like