Skip to player
Skip to main content
Skip to footer
Search
Connect
Watch fullscreen
Like
Comments
Bookmark
Share
Add to Playlist
Report
Learn Programming Technique C to Master Skills - Bubble Sort ( Continue .... )
Tutorials Arena
Follow
10/20/2024
Category
š
Learning
Transcript
Display full video transcript
00:00
Hello everyone, today I am going to explain bubble sort, how to arrange values which are
00:09
there inside the array in numerical sorted order.
00:14
Let us first understand with this diagram, what is the methodology of bubble sorting
00:23
take place.
00:25
Here if you see there are four iteration, this is the first iteration, this is the second
00:30
iteration, this is the third one and the fourth and at the last we get the result.
00:37
The values are inside the array in random order, I have shown the array in a vertical
00:44
form and the values inside it are in random order.
00:51
What is the methodology, how the things work, the jth position value is going to compare
01:02
with the first position value and if the jth position value is greater than first position
01:10
value, then the values are going to interchange, 13 is going to the jth position and 14 is
01:18
going to the first position, as the 14 is greater than 13, so 13 is at the jth and 14
01:25
is the first.
01:27
Then the first position value is going to compare with the second, if the condition
01:32
true then interchange will take place otherwise not, 14 greater than 15, interchange will
01:40
not take place, the values will remain in its own position, so 14 is at the first and
01:47
15 is at second.
01:51
Now we will move to further down to the second position, the second position is compared
02:01
with the third position, 15 greater than 12, so the 12 is at the second position and 15
02:07
is at the third and then 15 is compared to the last one, 15 greater than 11, so 15 is
02:15
at the third position, sorry 11 is at the third position and 15 is at the fourth position,
02:23
interchange take place.
02:26
Now if you see from downside the arrangement will take place, now we have got 15 at the
02:35
last index position, again the iteration will start but it will go one less than
02:45
last position, 13 is compared with 14, sorry the interchange will not take place,
02:52
that is not greater than 14.
02:55
Then one step down, the first position is compared with 12, 14 greater than 12, yes
03:01
interchange take place, 12 is above and 14 come down and 14 is compared with 11,
03:09
14 greater than 11, yes again the condition is true, 11 is upside and 14 is the down
03:19
and when you see here, so the arrangement is what taking place, here is 14 and here is 15.
03:29
Now again it will start from jth position, jth is compared with first,
03:33
yes the interchange will take place, 12 will go up and 13 will come down,
03:38
then 13 is compared with 11, 13 greater than 11, yes the interchange will take place,
03:44
the swapping will take place, 11 will go to the first position
03:48
and 13 will come to the second position.
03:52
So in this way the arrangement will take place, at last the jth position value is compared with
03:58
the first one, yes interchange will take place and at last we will get the result.
04:08
So first of all the four iteration take place in the iteration one,
04:12
then one less than, then three iteration, then two and then one and we will get the final result.
04:19
So I am going to make the program in my next class.
04:22
Thanks for today.
Recommended
5:36
|
Up next
Learn Programming Technique C to Master Skills - Selection Sort ( Continue...)
Tutorials Arena
11/1/2024
12:22
Learn Programming Technique C to Master Skills - Bubble Sort Program
Tutorials Arena
10/20/2024
3:37
Learn Programming Technique C to Master Skills - Pointers And Arrays Program ( Continue...)
Tutorials Arena
11/9/2024
3:28
Learn Programming Technique C to Master Skills - Switch Case Program ( Continue ...)
Tutorials Arena
10/19/2024
3:16
Learn Programming Technique C to MasterĀ Skills - First Program of Function ( Continue ...)
Tutorials Arena
11/3/2024
4:25
Learn Programming Technique C to Master Skills - Linked List ( Add Node Program ) Continue...
Tutorials Arena
11/30/2024
3:52
Learn Programming Technique C to Master Skills - Second Program of Loop (Flow Chart)
Tutorials Arena
10/17/2024
4:57
Learn Programming Technique C to Master Skills - Loop With If Statement Program ( Flow Chart )
Tutorials Arena
10/13/2024
3:51
Learn Programming Technique C to Master Skills - First Program of Loop (Flowchart)
Tutorials Arena
10/13/2024
5:29
Learn Programming Technique C to Master Skills - Continuous If Program (Flow Chart)
Tutorials Arena
10/8/2024
3:27
Learn Programming Technique C to Master Skills - Third Program of Loop ( Flow Chart)
Tutorials Arena
10/17/2024
3:21
Learn Programming Technique C to Master Skills - Third Program - Call by Reference (continue...)
Tutorials Arena
11/8/2024
3:51
Learn Programming Technique C to Master Skills - First Program of Loop (For Loop)
Tutorials Arena
10/13/2024
4:17
Learn Programming Technique C to Master Skills - Linked List ( Create Node Program)
Tutorials Arena
11/30/2024
4:57
Learn Programming Technique C to Master Skills - Loop with If Statement Second Program Continue...
Tutorials Arena
10/17/2024
3:55
Learn Programming Technique C to Master Skills - First Program of Loop (While Loop)
Tutorials Arena
10/13/2024
6:03
Learn Programming Technique C to Master Skills - Linked List ( Second Program)
Tutorials Arena
11/30/2024
7:02
Learn Programming Technique C to Master Skills - Sixth Program of Array (Loop with if)
Tutorials Arena
11/1/2024
2:58
Learn Programming Technique C to Master Skills - Nested If Statement Program (Flow Chart)
Tutorials Arena
10/12/2024
5:33
Learn Programming Technique C to Master Skills - Fourth Program of Loop ( While Loop )
Tutorials Arena
10/13/2024
4:39
Learn Programming Technique C to Master Skills - If... else if Statement Program (Flowchart)
Tutorials Arena
10/8/2024
4:03
Learn Programming Technique C to Master Skills - Second Program of Loop ( For Loop )
Tutorials Arena
10/17/2024
8:06
Learn Programming Technique C to Master Skills - Linked List ( First Program)
Tutorials Arena
11/30/2024
4:07
Learn Programming Technique C to Master Skills - Second Program of Loop (While Loop)
Tutorials Arena
10/17/2024
4:01
Learn Programming Technique C to Master Skills - Fourth Program of Loop ( Flow Chart )
Tutorials Arena
10/13/2024