Tech Unleashed

Wohoo!! We're on YouTube

Tuesday, 14 November 2023

C++ : Lecture 6: Bubble Sort Algorithm : C++ Confusion Buster !

 C++ Confusion Buster: Your Easy Guide to C++ !


Bubble Sort Algorithm code [C++] :


// Shyam Sunder Kanth
// Insta : still_23.6_8
// ?Bubble sort

#include<iostream>

using namespace std;

int main()
{
    int arr[5] = {5,4,3,2,1};
    int len = sizeof(arr)/sizeof(arr[0]);

    int cnt = 1;
    while(cnt<len){
        for(int i =0;i<len-cnt;i++){
            if(arr[i]>arr[i+1]){
                swap(arr[i],arr[i+1]);
            }
        }
        cnt++;
    }

    for(int i=0;i<len;i++){
        cout<<arr[i]<<" ";
    }
    return 0;
}

Hey, thanks for watching our video about Bubble Sort Algorithm ! In this video we’ll walk you through:

- Concept

- Definition

- Approach

- Code


All codes are available at my GitHub account, check them out here:

https://github.com/shyamkanth/Placements


Check out other videos from DS Revealed playlist: https://www.youtube.com/playlist?list=PLNXqJgOsTCZOB60T9HDhMf_o8RXbNWgqS


Check out our channel here: https://www.youtube.com/@DevelopersByte


Find us at: https://shyamkanth.github.io/


Timestamps:

0:00 Intro

01:25 Concept

02:32 Definition

05:42 Approach

16:20 Code

20:25 Outro


About our channel:

Our channel is about Revealing the secrets of Data Structure. We cover lots of cool stuff such as Codes, Concepts and Implementations.

Check out our channel here: https://www.youtube.com/@DevelopersByte

Don’t forget to subscribe!


Follow me on social media:

Get updates or reach out to Get updates on our Social Media Profiles!

GitHub: https://github.com/shyamkanth/

Instagram: https://instagram.com/still_23.6_8

Instagram personal: https://instagram.com/itz_sammmii

No comments:

Post a Comment