At Timestamp: 1:04:00. The flag variable must be declared inside the first for loop and before 2nd for loop. void bubbleSort(int arr[], int n) { int i, j; int flag ; for (i = 0; i < n-1; i++) { flag = 0; for (j = 0; j < n-i-1; j++) { if (arr[j] > arr[j+1]) { swap(&arr[j], &arr[j+1]); flag = 1; } } if (flag == 0) break; } }
At Timestamp: 1:04:00.
The flag variable must be declared inside the first for loop and before 2nd for loop.
void bubbleSort(int arr[], int n)
{
int i, j;
int flag ;
for (i = 0; i < n-1; i++)
{
flag = 0;
for (j = 0; j < n-i-1; j++)
{
if (arr[j] > arr[j+1])
{
swap(&arr[j], &arr[j+1]);
flag = 1;
}
}
if (flag == 0)
break;
}
}
shi kaam to kr rha h bhai...tu dimag chla rha h itna
whi declare hua h dhyan se dekh...
Teaching style is awsome
Enjoyed The Lecture.....
Bahut dhanyavad 🙏🙏🙏
Thankyou sir for such an amazing explanation
Please upload remaining DSA topics lecture sir🙏
Starts from 5:45
Sir can I get PPT of these videos? I have checked telegram group but didn't get there.
Sir where I can get the PPTs of these videos, can't find on telegram. BTW AWESOME VIDEO👌
PPT mili aapko??
noice
Bahut dhanyavad 🙏🙏🙏