Reverse an Array - Solution | Functions and Arrays | Data Structures and Algorithms in JAVA

preview_player
Показать описание


#pepcoding #programming #freonlinecourses
Рекомендации по теме
Комментарии
Автор

i was so confused in swapping, i was studying from coding ninja, after watching the explanation of swapping in one of your video, now the swapping is clear to me, thanks Malik saab, Jai Haryana ❤❤

rohitmadaan
Автор

Sir, is this the most efficient way to reverse the array?

PankajYadav-kfdl
Автор

Hello sir.
Sir can we do this question without string builder and buffer reader. Because sir i am doing this playlist syllabus wise the array comes before stack and queues. And you have posted some array videos before stack and queues and some after it. So i request you to please arrange this playlist serial wise.

raghavgupta
Автор

int size = a.length;
int count = size-1;

for (int i=0; i<=size/2; i++){
int temp = a[i];
a[i] = a[count];
a[count] = temp;
count--;
}
problem with this??

shalusingh
Автор

for(int i = a.length-1; i >=0; i--){

System.out.print(a[i]+" ");


}

aise bhi saaare test case pass ho gya sir ... kya shi hai .. hmene display vale function ko comment kr diya q ki array ke element 2 baar print ho rhe the ...

neerajyadav
visit shbcf.ru