Counting Sort | Easiest explanation with example

  Рет қаралды 330,115

Gate Smashers

Gate Smashers

Күн бұрын

👉Subscribe to our new channel: / @varunainashots
👉Links for DAA Notes:
🔗File-1: rb.gy/2byrg
🧑‍🎓Contributed by: Junaid Gazi
🔗File-2:
🧑‍🎓Contributed by: Mannu Garg
Counting sort is a sorting technique based on keys between a specific range. It works by counting the number of objects having distinct key values (kind of hashing). Then do some arithmetic to calculate the position of each object in the output sequence.
Counting sort is a stable sorting technique, which is used to sort objects according to the keys that are small numbers. It counts the number of keys whose key values are same. This sorting technique is effective when the difference between different keys are not so big, otherwise, it can increase the space complexity.
►Design and Analysis of algorithms (DAA) (Complete Playlist):
• Design and Analysis of...
Other subject-wise playlist Links:
--------------------------------------------------------------------------------------------------------------------------------------
► Operating System :
• Operating System (Comp...
►Database Management System:
• DBMS (Database Managem...
► Theory of Computation
• TOC(Theory of Computat...
►Artificial Intelligence:
• Artificial Intelligenc...
►Computer Networks (Complete Playlist):
• Computer Networks (Com...
►Computer Architecture (Complete Playlist):
• Computer Organization ...
►Structured Query Language (SQL):
• Structured Query Langu...
►Discrete Mathematics:
• Discrete Mathematics
►Compiler Design:
• Compiler Design (Compl...
►Number System:
• Number system
►Cloud Computing & BIG Data:
• Cloud Computing & BIG ...
►Software Engineering:
• Software Engineering
►Data Structure:
• Data Structure
►Graph Theory:
• Graph Theory
►Programming in C:
• C Programming
►Digital Logic:
• Digital Logic (Complet...
---------------------------------------------------------------------------------------------------------------------------------------
Our social media Links:
► Subscribe to us on KZbin: / gatesmashers
►Subscribe to our new channel: / @varunainashots
► Like our page on Facebook: / gatesmashers
► Follow us on Instagram: / gate.smashers
► Follow us on Instagram: / varunainashots
► Follow us on Telegram: t.me/gatesmash...
► Follow us on Threads: www.threads.ne...
--------------------------------------------------------------------------------------------------------------------------------------
►For Any Query, Suggestion or notes contribution:
Email us at: gatesmashers2018@gmail.com

Пікірлер: 113
@Bazriya-p1f
@Bazriya-p1f 9 ай бұрын
Sir hum apne junior ko suggest krte h aapki videos k liye but sir Hume aapke chhenal ka sahi s name yaad ni hota h ....plz name change krai chahe kol gate hi rakh lo😂
@GateSmashers
@GateSmashers 9 ай бұрын
“Varun Singla” name se share kar diya karo..
@Bazriya-p1f
@Bazriya-p1f 9 ай бұрын
Ok
@Tush_ars_
@Tush_ars_ Жыл бұрын
Concept Clear
@cool-vv5hk
@cool-vv5hk Жыл бұрын
Sir pls send sell sort video link
@Aakashhoney278
@Aakashhoney278 Жыл бұрын
bhai tum lalchi bhot ho
@palanikumar4997
@palanikumar4997 5 ай бұрын
you are approaching one format okay your element range 0 to 9 only. but your approach never works all times. A=10, 8, 12, 9, 10, 11, 12, 10, 9, 8 this series never works your approach I can challenge you [23, 12, 34, 18, 25, 23, 19, 20, 18, 23], [2,1,1,0,2,5,4,0,2,8,7,7,9,2,0,1,9]. you fix the range 0 to 5 only. how is it possible these series?
@abhishekdhiman6500
@abhishekdhiman6500 2 жыл бұрын
Told about your channel to my friend, now whole batch watches your video ✌🏻❤️
@bibhukishan6576
@bibhukishan6576 Жыл бұрын
Correction: Count sort is based on stable sort which means that relative order of values in original array should not be disturbed. So we can't directly print the array just by looking at the frequency of the elements . After storing the frequency of elements, we will update the frequency array by storing the prefix sum and then only we will form a new array of size equal to the original array and we will traverse the original array and store the values in the new array in accordance with the prefix sum .
@Singh_Ankit
@Singh_Ankit Жыл бұрын
Ya his method is not correct
@parthanuj8611
@parthanuj8611 Жыл бұрын
But radix sort is stable sort
@Coder-rohits
@Coder-rohits Жыл бұрын
bro i didn't got ur point can u pls explain me
@smitpatel9275
@smitpatel9275 Жыл бұрын
Yes, this method isn't correct Many youtubers use this method but it's wrong. My marks got deducted 😢.
@abdullahkhalid3055
@abdullahkhalid3055 11 ай бұрын
kzbin.info/www/bejne/pnatmnp5YrSVh6c
@saipranavi3725
@saipranavi3725 2 жыл бұрын
I was stressed when I didn't find this topic in your videos. Now, iam happy. Thank you.
@selfcreator3841
@selfcreator3841 Жыл бұрын
Your college???
@achievewithgyanu632
@achievewithgyanu632 Жыл бұрын
That is right 👍👍
@vekariyadharmik7776
@vekariyadharmik7776 2 жыл бұрын
Legends watching at 11:18 AM 🔥🔥
@iamnehanupur
@iamnehanupur Жыл бұрын
After watching a lot of videos I got my doubts clear only by you sir. Thank you so much. 🙏🏻
@statusvibz
@statusvibz 11 күн бұрын
Are you teaching wrong or what??? How can someone explain in such an easiest way ....☺
@Eswar.
@Eswar. 2 жыл бұрын
You are a great teacher I would love to train for GATE under you Hope you will help
@Mayankcodezz
@Mayankcodezz 2 жыл бұрын
True
@kiranbendigeri2238
@kiranbendigeri2238 Жыл бұрын
Explanation is very clear...Excellent. :)
@shreyanshjain2135
@shreyanshjain2135 11 ай бұрын
True big brother
@shashanksingh3027
@shashanksingh3027 2 жыл бұрын
dont speek subsribers bahut jaroori hai as we all know you are paid on the basis of subscribers
@theknowingeye5998
@theknowingeye5998 Жыл бұрын
no, paid on the basis of views bozo
@sahidurrahman6175
@sahidurrahman6175 2 жыл бұрын
The title of the video 'Easiest explanation' is absolutely right. Keep teaching us.
@LearningStudents-i9y
@LearningStudents-i9y 10 ай бұрын
Sir Asslum-o-alikum , I like your lectures , so Sir plz made lectures on information security.
@Manii83
@Manii83 4 ай бұрын
Prove helpful before exam's 2 hours ❤
@deepeshmittal4703
@deepeshmittal4703 2 жыл бұрын
Got selected in ibps so it officer with help of you thank you sir
@Eclipso619
@Eclipso619 2 жыл бұрын
Congratulations Brother....... 🎊🎉🎊🎉 You Rocks 🥰🥰🥰 Last but not Least Mera to Nahin Hua....... I'm accepting my defeat Like a King 👑 Muje to tabhi interview k time hi pata chal gaya tha Jab Chocolate khila kar bola tha Shaadi waadi Karo Abhi tumhari Age hi Kya Hai 😂😂😂
@Chaudharyhammad
@Chaudharyhammad 2 жыл бұрын
@@Eclipso619😂
@Eclipso619
@Eclipso619 2 жыл бұрын
@@Chaudharyhammad Kya kare Ab............. Mili hi Nahi Iss Rocky ko Uski Reena Koi 🤭
@Chaudharyhammad
@Chaudharyhammad 2 жыл бұрын
@@Eclipso619 mil jye ge bro don't worry Allah de ga
@Eclipso619
@Eclipso619 2 жыл бұрын
@@Chaudharyhammad Accha ........ Meri Tamanna Puri Ho To Fir........ 🥰🥰🥰 Dua me Yaad Rakhna 🤟🎯🤟
@moonthoughts8822
@moonthoughts8822 Жыл бұрын
The thing I was trying to understand from days and you make me learned in few minutes. ALLAH BLESS you.
@dsadaddy8403
@dsadaddy8403 Жыл бұрын
AMEEN
@JohnWick-fc2xz
@JohnWick-fc2xz Жыл бұрын
Nice and clear >> Understand on 1st turn. better than apna college.
@dhruvtomar9788
@dhruvtomar9788 8 ай бұрын
Sir aap college exam , interview , competitive exam bol dete ho isliye jadatar bachhe dekh lete video 😂
@amanmalik2081
@amanmalik2081 7 ай бұрын
Paid courses se better hai yeh
@abdulhanan8852
@abdulhanan8852 2 жыл бұрын
Mujhe pta ha cs walo tm b dekh rae ho comment krna😂
@PrajjwalNair
@PrajjwalNair Жыл бұрын
Good to see KL Rahul move to teaching line after his constant failures for India. 😊
@dragonhot6951
@dragonhot6951 10 ай бұрын
how will this works for negative numbers
@robayatrafsun102
@robayatrafsun102 8 ай бұрын
how will it work if the rang is N and there is certain amount of inputs ..??
@Vikatuofficial
@Vikatuofficial Жыл бұрын
video starts at 0:40 sec
@nomaneeium2940
@nomaneeium2940 2 жыл бұрын
842K 😍 On the way to 1M🎉🎉 Party Karna hainnnnnn sir jiiii 1M hone par...🎉🎉🎉
@Eclipso619
@Eclipso619 2 жыл бұрын
Where r U from.............. Brother, Bangladesh Maybe 🎭
@nomaneeium2940
@nomaneeium2940 2 жыл бұрын
@@Eclipso619 Yeah Right I'm from BD!
@Mayankcodezz
@Mayankcodezz 2 жыл бұрын
Yes true ❣️❣️
@priyankachachar8777
@priyankachachar8777 2 жыл бұрын
Yesterday I was searching for your counting sort video and couldnt find..and today you uploaded the video what a coincedence
@Mayankcodezz
@Mayankcodezz 2 жыл бұрын
Nice
@shahraizimtiaz6558
@shahraizimtiaz6558 Жыл бұрын
Allah aplogo ka bhala kre, Itna easily samjhaya, jo hamain University main samajh hi nai tha araha, Love u sir❤❤💯💯
@vyrsh0
@vyrsh0 3 ай бұрын
this is different counting sort algorithm, but if we are getting marks in exams, then its good ig.
@utsavp
@utsavp 2 жыл бұрын
Woahh, new board!! Congratulations sir :)
@SanketSharmasanket7317
@SanketSharmasanket7317 2 ай бұрын
ok
@ayushiyadav1
@ayushiyadav1 4 ай бұрын
you are a genius sir....lots of love!
@EzioAuditore-vr1oy
@EzioAuditore-vr1oy Жыл бұрын
There are another couple of steps that make this algorithm stable.
@Tamanna_K_Hardy
@Tamanna_K_Hardy 2 жыл бұрын
First Comment Great as Always 👍
@baundulegamer
@baundulegamer Ай бұрын
Legends are watching it at 12.53 am 😊
@shreyanshjain2135
@shreyanshjain2135 11 ай бұрын
Welcome😊
@tania1418
@tania1418 2 жыл бұрын
hats off💕 love from pakistan
@sgmusic9775
@sgmusic9775 Жыл бұрын
thankyou so much sir very good explanation
@BSEss
@BSEss Жыл бұрын
Ciao @Varun Bhai, please rectify this video of yours. It's misleading.
@DrMuzis
@DrMuzis Жыл бұрын
bro why your video look like an english video but it's not? downvoted..
@skchoudhary7956
@skchoudhary7956 2 жыл бұрын
DAA series..🤩
@zeshanghafoor6046
@zeshanghafoor6046 Жыл бұрын
👏👏👏 Thanks for explaining.
@shahabkhan1765
@shahabkhan1765 Жыл бұрын
nice sir
@Imaginary_World-k9m
@Imaginary_World-k9m 8 ай бұрын
Ever Green Channel🙌❤
@poojapoojadhapte1430
@poojapoojadhapte1430 Жыл бұрын
Radix sort i thought very diffcult see ur videos beautiful
@devkothari645
@devkothari645 Жыл бұрын
Sir aapkaIntro song kisi aur website ka bahaut yaad dilata hai
@srilakshmimancha8204
@srilakshmimancha8204 2 жыл бұрын
forgot about posting radix sorts time complexity details.
@Rz_clip
@Rz_clip Жыл бұрын
please add some content and algorithm with it related topic
@jogendrakumar7685
@jogendrakumar7685 2 жыл бұрын
Wow sir Aap great Ho Aap ka asan kaise chukaye sir
@Voltage-ee4vd
@Voltage-ee4vd 3 ай бұрын
space complexity will be O(n+k) na!
@Akshita-k1z
@Akshita-k1z 2 ай бұрын
its a time complexity not space complexity
@RahulSingh-z2t5l
@RahulSingh-z2t5l 3 ай бұрын
rahul dua
@mahimakaushal7381
@mahimakaushal7381 2 жыл бұрын
I am unable to get videos where time complexity is explained for Counting Sort and Radix Sort Sorting explanation is awesome please help to get related other vides
@Eclipso619
@Eclipso619 2 жыл бұрын
1st Comment............. 🤭 You Rocks Sir 🔥🎯🔥
@Seerat_-ns5ih
@Seerat_-ns5ih Жыл бұрын
Sir, if we have 10,25,22,15,18,21,24 Then what will be its range? And plz reply it's important
@abdurrahmansikder4673
@abdurrahmansikder4673 Жыл бұрын
25
@patelvishv9217
@patelvishv9217 Жыл бұрын
This method is not correct sir correct it
@mycollegeLife.
@mycollegeLife. Жыл бұрын
where is redix short next video sirji?
@dr.amandeep6752
@dr.amandeep6752 Жыл бұрын
My all colleagues and students follow u
@MadhuKumari-pz2jo
@MadhuKumari-pz2jo 2 жыл бұрын
Pgt haryana ki tyari kra do c and c++
@SIDDHANTRAAJ-q2h
@SIDDHANTRAAJ-q2h 14 күн бұрын
17/09/24 :)
@SIDDHANTRAAJ-q2h
@SIDDHANTRAAJ-q2h 14 күн бұрын
17/09/24 :)
@pewpewpew1177
@pewpewpew1177 Жыл бұрын
Subscribers bhut jarrori hai 🦾
@rishusingh1995
@rishusingh1995 3 ай бұрын
great explanation 🙏🏻
@AnshuPatel-m2r
@AnshuPatel-m2r 22 күн бұрын
1:20
@chilled_beer821
@chilled_beer821 Жыл бұрын
happy teachers day sir
@azimtalukdar5556
@azimtalukdar5556 Жыл бұрын
What if array contains 0 or negative value.
@gamerversez5372
@gamerversez5372 Жыл бұрын
For 0 it will work, but not for negative numbers as indexs are not negative
@Neosam01
@Neosam01 6 ай бұрын
bohot badhiya
@sudershansingh2839
@sudershansingh2839 2 жыл бұрын
mast algorithm hai
@Disruptivetechnology-s6x
@Disruptivetechnology-s6x Жыл бұрын
OG Varun Singla
@lord_yzal
@lord_yzal 2 жыл бұрын
completedgoodvibes
@pratikashokkolamuskar1389
@pratikashokkolamuskar1389 Жыл бұрын
thankyou sir
@wisdomkhan
@wisdomkhan 2 жыл бұрын
people have put half an hour videos to explain this simple concept. 5 mins are more than enough.
@amannegi8425
@amannegi8425 Жыл бұрын
bhai glt pdha diya h 5 min k chkr m🤣
@wisdomkhan
@wisdomkhan Жыл бұрын
@@amannegi8425 ohh, kya error h?
@amannegi8425
@amannegi8425 Жыл бұрын
@@wisdomkhan this method only work for small integer.. But cannot be used as general purpose algo for sorting object with multiple members.
@24306529
@24306529 Жыл бұрын
(N+K) or (NxK) ?
@taha7shaikh
@taha7shaikh Жыл бұрын
Thank you so much
@MuskanKaur-lh3ig
@MuskanKaur-lh3ig Жыл бұрын
well explaind
@kathyawadipatidar
@kathyawadipatidar Жыл бұрын
@IFIslam
@IFIslam 2 жыл бұрын
I have a question... Why we write time complexity as O (n + k) always instead of writing actually values? Is tarah to har counting sort ki yehi time complexity hogi?
@DuskyDaily
@DuskyDaily 2 жыл бұрын
Yes, har counting sort ki yehi time complexity hogi. As Time complexity is a general association of an algorithm's worst case time to the input. Agaar n barega, to time bhi barega. Lekin time kitna barega relative with n, vo ha time complexity. Yahan time linearly n ke saath bar raha ha. O(n). Allag algorithms ki time complexity allag ho sakti ha, jaise bubble sort ki O(n^2).
@dhruvilsolanki9887
@dhruvilsolanki9887 Жыл бұрын
great explaination
@PANKAJ_KHUDIA
@PANKAJ_KHUDIA 2 жыл бұрын
🙏🙏🤗🤗
Minecraft Creeper Family is back! #minecraft #funny #memes
00:26
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 68 МЛН
Incredible: Teacher builds airplane to teach kids behavior! #shorts
00:32
Fabiosa Stories
Рет қаралды 11 МЛН
Radix Sort | Easiest explanation with example
6:05
Gate Smashers
Рет қаралды 393 М.
L-3.13: Heap sort with Example | Heapify Method
13:38
Gate Smashers
Рет қаралды 952 М.
2.8.1  QuickSort Algorithm
13:43
Abdul Bari
Рет қаралды 3,2 МЛН
2.6.3 Heap - Heap Sort - Heapify - Priority Queues
51:08
Abdul Bari
Рет қаралды 2,1 МЛН
Learn Counting Sort Algorithm in LESS THAN 6 MINUTES!
5:59
CS Dojo
Рет қаралды 343 М.
Count Sort Algorithm - Theory + Code
20:44
Kunal Kushwaha
Рет қаралды 21 М.
Minecraft Creeper Family is back! #minecraft #funny #memes
00:26