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
4867 test 1 23 Ev 26-Jul-2022 10:30:46 AM
4866 VideoHot 26-Jul-2022 08:03:07 AM
4865 test 12 26 M 25-Jul-2022 04:13:15 PM
4864 test 11 26 M 25-Jul-2022 04:12:10 PM
4863 test 8 26 M 25-Jul-2022 04:06:09 PM
4862 test 5 26 M 25-Jul-2022 04:04:24 PM
4861 test 4 26 M 25-Jul-2022 04:02:33 PM
4860 test 3 26 M 25-Jul-2022 03:46:17 PM
4859 code 25-Jul-2022 03:33:57 PM
4858 test 2 26 E 25-Jul-2022 03:01:32 PM
4857 test 1 26 M 25-Jul-2022 03:00:12 PM
4856 . 23-Jul-2022 09:16:04 PM
4855 UPDATED KID 23-Jul-2022 07:29:36 AM
4854 Beauty Lady 21-Jul-2022 08:43:09 AM
4853 UPDATED KID 20-Jul-2022 07:51:51 AM
4852 She is too 18-Jul-2022 11:05:25 AM
4851 HotVideos 15-Jul-2022 12:43:40 PM
4850 KIDDO VIDEOS 14-Jul-2022 08:47:38 AM
4849 UPDATE KIDDO 07-Jul-2022 07:34:23 AM
4848 Real SexyHot 05-Jul-2022 08:19:40 AM
4847 04-Jul-2022 07:07:30 PM
4846 UPDATE KIDDO 01-Jul-2022 11:15:43 AM
4845 PrettySexy 28-Jun-2022 01:18:54 PM
4844 26-Jun-2022 10:03:07 AM
4843 BEST NEW KID 25-Jun-2022 11:06:39 AM
4842 21-Jun-2022 07:05:47 PM
4841 S3xy Girls 08-Jun-2022 08:54:39 AM
4840 05-Jun-2022 08:20:05 AM
4839 31-May-2022 09:38:59 PM
4838 Tv 29-May-2022 10:43:08 PM

[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