Java Program #21 - Sort Numbers using Bubble Sort in Java

  Рет қаралды 39,176

Programming For Beginners

Programming For Beginners

Жыл бұрын

Java Program to Sort Numbers using Bubble Sort Algorithm | Programming for Beginners
In this video by Programming for Beginners we will learn to write Java Program to Sort Numbers using Bubble Sort Algorithm, using Java Tutorial videos.
This Java program is very important for your Java interview questions or if you are learning Java Programming language as a student.
Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in the wrong order.
This algorithm is suitable for small data sets.
Example:
Input: arr[] = {5, 1, 4, 2, 8}
Output: arr[] = {1, 2, 4, 5, 8}
==========
Java Tutorial for Beginners Playlist:
• Java Tutorial
All Java Programs Playlist:
• Java Programs
We can learn Java Programming language to make web applications or mobile applications for android phones and several other applications for windows, Mac OS and Unix operating systems. Also we can make android applications using Java programming. The concepts covered will be related to basic java and core java that will help you in your next interview questions. You can use any version of Java but all concepts will be same for all java versions. I will be using Java SE 8.
Java is a high-level programming language. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.
Java is a MUST for students and working professionals to become a great Software Engineer specially when they are working in Software Development Domain.
Java JDK:
www.oracle.com/java/technolog...
Eclipse IDE:
www.eclipse.org/downloads/
KZfaq Gears:
Microphone: amzn.to/3iIk5K3
Mouse: amzn.to/35irmNF
Laptop: amzn.to/3iG0jyD
#JavaProgram #JavaTutorial #Programming #Java
============================
LIKE | SHARE | COMMENT | SUBSCRIBE
Thanks for watching :)

Пікірлер: 40
@poorpanda9033
@poorpanda9033 11 ай бұрын
Thank You ! Very clearly explained..
@programmingforbeginners7392
@programmingforbeginners7392 11 ай бұрын
Glad it was helpful!
@parkergaming3123
@parkergaming3123 8 ай бұрын
Thank you soo much ! Very well explained brother. Keep it up ! Already Subscribed to you channel. Love from Mumbai
@programmingforbeginners7392
@programmingforbeginners7392 8 ай бұрын
Thank you so much. Love from Pune :)
@mnggamer6762
@mnggamer6762 Жыл бұрын
Thank u so much , easily understand explanation..........
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
You are most welcome
@pelayojhonmeltonmanio8898
@pelayojhonmeltonmanio8898 10 ай бұрын
Thank you so much! hope I can learn more from you sir.
@programmingforbeginners7392
@programmingforbeginners7392 10 ай бұрын
Welcome.. subscribe and share with your friends
@lukearnold6754
@lukearnold6754 10 ай бұрын
On God, this is the best solution i have seen till now🔥🔥
@programmingforbeginners7392
@programmingforbeginners7392 10 ай бұрын
Thanks. Please subscribe and share with your friends 🙂
@kainaatmakhani6550
@kainaatmakhani6550 Жыл бұрын
the lecture was very good.
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
thanks
@kela123keta8
@kela123keta8 Жыл бұрын
Thanks sir your video helped me so much
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
Glad it was helpful. Share with your friends 🙂👍
@tharinduminiruwan7842
@tharinduminiruwan7842 Жыл бұрын
Thank you so much, good explanation ❤️
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
Welcome 👍🙂
@tharinduminiruwan7842
@tharinduminiruwan7842 Жыл бұрын
Keep it up ❤️
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
yes thanks. keep supporting :)
@revtey
@revtey 6 ай бұрын
And for descending order?
@Unknown_user-md5ur
@Unknown_user-md5ur Жыл бұрын
Thank you 😊
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
You're welcome 😊
@pnprashant671
@pnprashant671 7 ай бұрын
Bro, please explain why did you write for loop with i again in the end?
@programmingforbeginners7392
@programmingforbeginners7392 7 ай бұрын
last for loop with i is to print all numbers in array after sorting them, in the format we want, space separated or using commas, etc.
@aayushpillai3207
@aayushpillai3207 9 ай бұрын
Thankx
@programmingforbeginners7392
@programmingforbeginners7392 9 ай бұрын
Welcome
@user-xj1mm1ts9r
@user-xj1mm1ts9r Жыл бұрын
thank you sir
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
Welcome
@Rajkumar32356
@Rajkumar32356 Ай бұрын
How to sort alphanumeric
@gauravbadgujar8264
@gauravbadgujar8264 Ай бұрын
Make video for reverse array
@phanikande8814
@phanikande8814 Ай бұрын
Nice Explanation Sir 🙂
@programmingforbeginners7392
@programmingforbeginners7392 Ай бұрын
Thanks and welcome
@faisalshafiuddin1018
@faisalshafiuddin1018 10 ай бұрын
sir when I tried the code by myself, the code number line 8 of ur code where " j< length -i", where the "i" is used because you said we dont want to swap the last element during the 2nd iteration. but when I tried the code by myself I noticed if I just wrote "j < length" it gives me the same result sorted in ascending order without the last element touched. so is it valid??
@programmingforbeginners7392
@programmingforbeginners7392 10 ай бұрын
If it's working for other combination of numbers than it's valid. Extra checks are being made in your case since the numbers in the end are already sorted after each iteration
@gosuace7951
@gosuace7951 Жыл бұрын
Its very hard to understand the for loops. I undertand what bubble sort is. But the code itself i cant understand
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
More practice will make your concepts easier
@yqiwndbduebkdne
@yqiwndbduebkdne Жыл бұрын
how about from highest to lowest output? badly need.
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
for highest to lowest - use condition arr[j-1] < arr[j]
@User1-f8h
@User1-f8h Жыл бұрын
In if condition why we need to take (arr[ j-1 ] >arr [ j ] ). Why we should not take ( [ j-1]>[ j ] ) by removing arr before j-1& j
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
j represents the position and arr[j] represents the number at that position so we have to use arr to compare numbers and not the positions for sorting
@priyanshusharma8784
@priyanshusharma8784 4 ай бұрын
Sir
Java Program #22 - Print Diamond Shape Star Pattern in Java
8:19
Programming For Beginners
Рет қаралды 30 М.
Bubble Sort Code in Java | DSA
8:14
Telusko
Рет қаралды 34 М.
Beautiful gymnastics 😍☺️
00:15
Lexa_Merin
Рет қаралды 15 МЛН
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 29 МЛН
НЫСАНА КОНЦЕРТ 2024
2:26:34
Нысана театры
Рет қаралды 791 М.
Learn Bubble Sort in 7 minutes 🤿
7:44
Bro Code
Рет қаралды 228 М.
Java Program #25 - Sort Numbers using Insertion Sort in Java
10:26
Programming For Beginners
Рет қаралды 14 М.
Learn Java in One Video - 15-minute Crash Course
14:54
Coding with John
Рет қаралды 672 М.
Python Program to Find LCM || Tamil
2:45
LECT
Рет қаралды 598
Learn Selection Sort in 8 minutes 🔦
8:21
Bro Code
Рет қаралды 212 М.
Bubble Sort Algorithm With Java Program by Deepak
33:17
Smart Programming
Рет қаралды 471 М.
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 627 М.
2.8.1  QuickSort Algorithm
13:43
Abdul Bari
Рет қаралды 3,1 МЛН
Bubble sort in 2 minutes
2:10
Michael Sambol
Рет қаралды 904 М.
Bubble sort algorithm
10:24
mycodeschool
Рет қаралды 1,7 МЛН
Beautiful gymnastics 😍☺️
00:15
Lexa_Merin
Рет қаралды 15 МЛН