Copy and Paste  -   An Application to Copy/Paste Text  

 
S.No 4814 Name code Date/Time 21-Apr-2022 12:19:57 PM

Copy text from below

# Python program for implementation of MergeSort

def mergeSort(arr):

if len(arr) > 1:

 

# Finding the mid of the array

mid = len(arr)//2

 

# Dividing the array elements

L = arr[:mid]

 

# into 2 halves

R = arr[mid:]

 

# Sorting the first half

mergeSort(L)

 

# Sorting the second half

mergeSort(R)

 

i = j = k = 0

 

# Copy data to temp arrays L[] and R[]

while i < len(L) and j < len(R):

if L[i] < R[j]:

arr[k] = L[i]

i += 1

else:

arr[k] = R[j]

j += 1

k += 1

 

# Checking if any element was left

while i < len(L):

arr[k] = L[i]

i += 1

k += 1

 

while j < len(R):

arr[k] = R[j]

j += 1

k += 1

 

# Code to print the list

 

 

def printList(arr):

for i in range(len(arr)):

print(arr[i], end=" ")

print()

 

 

# Driver Code

if __name__ == '__main__':

arr = [12, 11, 13, 5, 6, 7]

print("Given array is", end="\n")

printList(arr)

mergeSort(arr)

print("Sorted array is: ", end="\n")

printList(arr)

 

# This code is contributed by Mayank Khanna

 





comments powered by Disqus
NEW ENTRIES
S.No Name Entry Time/Date
4777 . 19-Feb-2022 02:30:42 PM
4776 New Hot Vid 19-Feb-2022 09:56:29 AM
4775 num sum 18-Feb-2022 11:22:24 PM
4774 ddd 18-Feb-2022 02:03:14 PM
4773 cc 18-Feb-2022 01:28:59 PM
4772 LCD1 18-Feb-2022 11:30:30 AM
4771 TransportGr 17-Feb-2022 11:22:33 PM
4770 akh 17-Feb-2022 12:59:55 PM
4769 bb 17-Feb-2022 12:45:30 PM
4768 aa 17-Feb-2022 12:13:24 PM
4767 Check 16-Feb-2022 01:44:59 PM
4766 16-Feb-2022 01:19:00 AM
4765 SexyVideos 14-Feb-2022 09:40:02 AM
4764 S3XY G1RLS 12-Feb-2022 07:53:23 AM
4763 SexyHot Vid 10-Feb-2022 09:45:33 AM
4762 OrangeMattre 05-Feb-2022 10:32:40 AM
4761 05-Feb-2022 10:32:14 AM
4760 05-Feb-2022 10:31:51 AM
4759 05-Feb-2022 10:31:11 AM
4758 04-Feb-2022 10:03:15 PM
4757 S3xy H0t 02-Feb-2022 09:02:19 AM
4756 . 01-Feb-2022 12:37:37 AM
4755 U 31-Jan-2022 04:14:45 PM
4754 India Sexy 29-Jan-2022 10:10:50 AM
4753 . 25-Jan-2022 07:18:45 PM
4752 . 25-Jan-2022 07:18:16 PM
4751 BollywoodHot 25-Jan-2022 09:07:06 AM
4750 H0t S3xy 24-Jan-2022 07:30:21 AM
4749 M1SS L0VE 22-Jan-2022 11:48:51 AM
4748 Girl & Boy 20-Jan-2022 10:34:54 AM

[First] [Prev] 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 [Next] [Last]
 
web counter
web counter


To report any error messages or bugs, or other issues, please send email at: info@pakproject.com