Merge Sort Using Python | Tamil | Quick Through |
ฝัง
- เผยแพร่เมื่อ 7 ก.ย. 2024
- Hello Guys!
In this Video, we going to
do merge sort in Python
Video Language:- Tamil
----------------------------------
ALGORITHM:
1.Create a function named mergesort
2. Find the mid of the list
3. Assign lefthalf = alist[:mid] and righthalf = alist[mid:]
4. Initialise i=j=k=0
5. while i (less than ) len(lefthalf) and j (less than) len(righthalf), perform the following
if lefthalf[i] (less than) righthalf[j]:
alist[k]=lefthalf[i]
Increment i
else
alist[k]=righthalf[j]
Increment j
Increment k
6. while i (less than) len(lefthalf),perform the following
alist[k]=lefthalf[i]
Increment i
Increment k
7. while j (less than) len(righthalf), perform the following
alist[k]=righthalf[j]
Increment j
Increment k
8. Print the sorted list
PROGRAM:
def mergeSort(alist):
print("Splitting ",alist)
if len(alist)(greater than)1:
mid = len(alist)//2
lefthalf = alist[:mid]
righthalf = alist[mid:]
mergeSort(lefthalf)
a=[]
n=int(input('Enter upper limit:'))
for i in range(n):
a.append(int(input()))
#alist = [54,26,93,17,77,31,44,55,20]
mergeSort(a)
print(a)
-----------------------------------------------
keywords : How to find merge sort in python tamil
How to find merge sort in python in tamil, Merge sort in python tamil
anna university lab manual tamil python laboratory merge sort in python
quick through , quick through tamil .
----------------------------------------------
thanks for watching this guys ! and make sure to
subscribe this channel:)
Thank brother I am not understand your language but I am understand your programming method.❤️👍
Super bro ...neenga vera lvl easily understandable
bro it was really helpful thanks lot bro
Better don't use background music other than that the explanation was clear
Easy to underdtand bro nice😇
Thank you bro🙏
Tq bro
Anna this is very useful and understandable
Bro next time lanthu background music kaa konjam kamikunga bro
But Explanation Pakka Bro
Supper bro
Thanks bro crystal clear explanation 👍😇🥵🥶
Super Bro...
Well Done ✅
Thank you so Much Bro ☺
super bro, referred many explanation yours is the best
Tqq bro🤜
Thanks brother ♥️
Tnx anna🥰
Thala vera level
bro for loop potrukeengala bro L kum R kum function call pandradhuku munaadi adhula namma yen bro elements ah i ku assingn pannaum
konjam clearpanunga bro
Cold🥶 aah bro?
Use snakecase or camelcase vro
Bro error varuthu bro
Why we are using l. Pop(0) and r. Pop(0)... Plz reply anna
Same doubt 🙁
Ena linux version bro
parrot os