# we know that the 'Bubble Sorting' and the 'Selection Sorting' Algorithm's Time Complexity = O(n ^ 2) 😎
# that's why the both Algorithm uses Nested loop 😎
# =============== Best Case ==============
# if you give a sorted list that means a ascending array to a Sorting Algorithm.
# then, The Algorithm should be very happy.🤩 It got the easiest job to sort a sorted list 😁
# The performance of a sorting Algorithm while sorting a sorted or ascending List is called the | "Best Case" | Performance. :)
# here, common sense as the sorted List already ascending list, so the Algorithm should not work much to sort this, Righ? That's why, it will be happy 🤩🤩
# ============== Worst Case ================
# Now, it's opposite of first one, 🥴
# If you give a descending sorted List to a Sorting Algorithm , then Algorithm will be sad 😏,
# that's why, it should work more here 🙄
# The performance of a sorting Algorithm while sorting a descending List is called the | "Worst Case" | Performance . :(
# There are some 'Advanced Sorting':
# There are a few advanced sorting algorithms you should google and learn. At least you should know their names.
# 1. Merge Sort
# 2. Quich Sort
# 3. Heap Sort
# and one more thing :)
# every Programming Language provides a By-default build-in sort ..........
# Python provides too...... look at below.....
arry = [44, 45, 768, 673, 8733, 3443]
arry.sort() # here we can pass reverse parameter....
print(arry) # explore own...
# and another as Bonus :)........
print(sorted(arry))
0 Comments