Video 24 of a series explaining the basic concepts of Data Structures and Algorithms. This video explains the time complexity analysis for bubble sort. This video is meant for educational purposes only.
I just came back from google chrome i saw the same hands and same piece of paper in that website also. Your voice is clear and explanation is also good. Thank you lady.
Why arr[j] = arr[j+1] is 2x, when there are 2 indexing operations and 1 assignment. I think it should be 3x only in that case. Any explanations please.
I have a question : Wouldn't the first loop go n times instead of n - 1 times ? Because it will need to run once more after i = 1 and change it to i = 0 before exiting the loop ? [edit] ok, I think I got it, since it skipped i = 0, it will only run n-1 times. thx
To clear your doubt, in the code shown in the video, the greatest element is being shifted to the last index each time thereby sorting it. This is an alternate approach to bubble sort. I recommend you to watch the video explaining this pseudo code, named "Bubble Sort - Pseudo Code". This code, once implemented in C++ or java will work.
first of all, I should thank you for your great presentation. the thing I could not understand is that how I can interpret the relationship between the worst case and big oh generated from the time function I would be grateful if you could help me understand it
I realized my misunderstanding. we write the worst and best case for our algorithm while I was thinking 2 different algorithms were assigned to both the worst and best case respectively
If u write any word u should know the meaning without meaning should not be explain it's iretating, ok u said t(n) =11/2 n(square) then according to ap where is -1if any one knows the answer plzz comment here
Asslam Aliakum! Anyone help please. You are required to calculate (Step by Step) the worst case time complexity T(n) of the algorithm designed. what will be the time complexity T(n) of this code? #include using namespace std; main() { int number, temp; int reverse = 0; cin>>number; temp=number; while (number>0) { reverse = (reverse*10) + number%10; number=number/10; } if(temp == reverse) cout
I just came back from google chrome i saw the same hands and same piece of paper in that website also. Your voice is clear and explanation is also good. Thank you lady.
Thanks for the video, I was looking for a recap on how to calculate time complexity and this helped a lot 👍
Thank you very much , this is the most clear explanation I watched. Thanks
Your video really helped a lot. Thank You
Great video, short and brief to the point!
Why arr[j] = arr[j+1] is 2x, when there are 2 indexing operations and 1 assignment. I think it should be 3x only in that case. Any explanations please.
I do have the same que N i guess there will be 3 pos as 2 indexing and one assignment
Thank you for this simple explanation!!
Thank you
Wonderful and succinct explanation... thank you!
you saved my grade... thank you very much
Nicely explained. Thanks.
really love your explanation style and subscribed
fan ho gaye hum aapki awaaz ke
thank you i love your explanation
Thank you for very good explanation :)
I have a question :
Wouldn't the first loop go n times instead of n - 1 times ?
Because it will need to run once more after i = 1 and change it to i = 0 before exiting the loop ?
[edit]
ok, I think I got it, since it skipped i = 0, it will only run n-1 times.
thx
excellent keep it up!
very clear, perfect, thank you
Thank You
Mam arr[j]=arr[j+1] ,i think it will take time 3x because there are three primitive operation .
Mam requesting you to solve my doubt.
Wonderful explanation, thank you so much.
wonderful explanation
arr[j] = arr[j+1] ; is not 3 primitive operations (2 indexing and one assignment) ???
May be j+1 is another primitive operation
Yaar, your voice really awesome
Very nice
thank you so much...
Thanks a ton mam veri clear and straightforward
ty, u saved me
Thank you so much
Fabulous..
best case?
thanks mam
Thank you subscribed and liked.
madam how to find best case time complexity ? could you please explain?
Why is it 11/2n*2 - 11/2n?
Mam ur voice is sweet❣ and well explained.
why did you only explain worst case, but not best case or average case?
can u please upload videos related to calculate time complexity of best case of sorting algorithms
Kindly explain 5.35 in brief manner i.e J loop iteration part
you made a mistake with the second for loop
mean
you have write :- for(j=0;j
To clear your doubt, in the code shown in the video, the greatest element is being shifted to the last index each time thereby sorting it. This is an alternate approach to bubble sort. I recommend you to watch the video explaining this pseudo code, named "Bubble Sort - Pseudo Code". This code, once implemented in C++ or java will work.
Mam your voice is so sweet♥️♥️♥️♥️
first of all, I should thank you for your great presentation.
the thing I could not understand is that how I can interpret the relationship between the worst case and big oh generated from the time function
I would be grateful if you could help me understand it
I realized my misunderstanding. we write the worst and best case for our algorithm while I was thinking 2 different algorithms were assigned to both the worst and best case respectively
Thank you Mam,mai exam aktu ds ko lekar pareshan hu aapane help kia,c programming aur algorithm aache se sikhane ke lia kya kare mam,please reply??😇😇
mam aapki aavaz AI mein jo human voice invoked hoti hai us jaisi hai
and please upload insert sort time complexity and (best case, worse case,)??
How to make balance sheets of financial statements
analyze the following code and compute its complexity.
a)
// C++ program for implementation of Bubble sort
#include
using namespace std;
void swap(int *xp, int *yp)
{
int temp = *xp;
*xp = *yp;
*yp = temp;
}
// A function to implement bubble sort
void bubbleSort(int arr[], int n)
{
int i, j;
for (i = 0; i < n-1; i++)
// Last i elements are already in place
for (j = 0; j < n-i-1; j++)
if (arr[j] > arr[j+1])
swap(&arr[j], &arr[j+1]);
}
/* Function to print an array */
void printArray(int arr[], int size)
{
int i;
for (i = 0; i < size; i++)
cout
not easily calculate, the only calculated by computers
If u write any word u should know the meaning without meaning should not be explain it's iretating, ok u said t(n) =11/2 n(square) then according to ap where is -1if any one knows the answer plzz comment here
Asslam Aliakum!
Anyone help please.
You are required to calculate (Step by Step) the worst case time complexity T(n) of the algorithm designed.
what will be the time complexity T(n) of this code?
#include
using namespace std;
main()
{
int number, temp;
int reverse = 0;
cin>>number;
temp=number;
while (number>0)
{
reverse = (reverse*10) + number%10;
number=number/10;
}
if(temp == reverse)
cout
Lalitha Natraj let me know the email ID.
Thank you