Theory –
Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order.
his algorithm is suitable for small data sets
Its average and worst case complexity are of – (n^2) where n is the number of items.
It is known as bubble sort, because with every complete iteration the largest element bubbles up towards the last place or the highest index just like a water bubble rises up to the water surface.
Working –
Step 1 – Starting with the first element(index = 0), compare the current element with the next element of the array.
Step 2 – If the current element is greater than the next element of the array, swap them.
Step 3 – If the current element is less than the next element, move to the next element.
Step 4 – Repeat Step 1 till the list is sorted.
Full DSA playlist –
Full Code & Theory article –
C++ Programming Tutorials for Beginners Course –
Simple Snippets Official Website –
Simple Snippets on Facebook –
Simple Snippets on Instagram –
Simple Snippets on Twitter –
Simple Snippets Google Plus Page –
Simple Snippets email ID –
simplesnippetsinfo@gmail.com
For More Technology News, Latest Updates and Blog articles visit our Official Website –
Nguồn: https://quydinh.com
Xem thêm bài viết khác: https://quydinh.com/cong-nghe
Xem thêm Bài Viết:
- Chia sẻ đầy đủ về cách hướng dẫn Ghost Win Xp bằng USB cơ bản từ A tới Z
- Hướng dẫn tạo file ghost win 10 thông qua 3 bước đơn giản mà bạn không nên bỏ qua
- Mách bạn 4 bước trong cách bung file tib theo chuẩn UEFI đơn giản nhất
- Mật bí 4 kiểu hyperlink trong excel bị lỗi phổ biến mà bạn hay gặp nhất
- Khái niệm ma alt là gì và cách sử dụng bảng mã ATL như thế nào?
Hey Guys, if you want more such tech educational videos on this channel then please support me by subscribing to this channel & also share it with your friends as it helps me create more content just for you ✌
My friend trust me you are be best, I tried many options but I couldn't understand the algorithm; until when I watched your videos.
thank you friend
Where the binary trees bro?
Best teaching.
What is the software or editor that you are using in this video. Please share the name of it please
I want to be atmost perfect in java please tell me
Bro please say me how to start java for absolutely begginers