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
4927 New Kiddo 06-Aug-2022 11:08:45 AM
4926 S E X Y She 06-Aug-2022 07:05:44 AM
4925 abx 03-Aug-2022 08:11:19 PM
4924 https://sqli 03-Aug-2022 05:07:27 PM
4923 Test 12 Aug4 03-Aug-2022 04:34:59 PM
4922 Test 11 Aug4 03-Aug-2022 04:22:05 PM
4921 Test 8 Aug4 03-Aug-2022 04:14:20 PM
4920 Test 5 Aug4 03-Aug-2022 03:39:21 PM
4919 Test 4 Aug4 03-Aug-2022 03:32:43 PM
4918 Test 3 Aug 4 03-Aug-2022 03:27:17 PM
4917 Test 2 Aug 4 03-Aug-2022 03:13:33 PM
4916 Test 1 Aug 4 03-Aug-2022 02:45:13 PM
4915 asdf 03-Aug-2022 02:40:37 PM
4914 asdf 03-Aug-2022 02:40:29 PM
4913 asdf 03-Aug-2022 02:40:18 PM
4912 asdf 03-Aug-2022 02:40:11 PM
4911 asdf 03-Aug-2022 02:39:56 PM
4910 asdf 03-Aug-2022 02:39:46 PM
4909 Test 1 Aug 4 03-Aug-2022 02:37:07 PM
4908 sdfa 03-Aug-2022 02:34:22 PM
4907 Test 1 Aug4 03-Aug-2022 02:32:30 PM
4906 Sexy Assets 03-Aug-2022 11:53:51 AM
4905 01-Aug-2022 07:27:04 PM
4904 Test 11 2Aug 01-Aug-2022 04:43:08 PM
4903 Test 8 2Aug 01-Aug-2022 04:32:49 PM
4902 Test 3 2Aug 01-Aug-2022 04:26:16 PM
4901 Test 2 2Aug 01-Aug-2022 04:25:53 PM
4900 Test 1 2Aug 01-Aug-2022 03:31:44 PM
4899 UPDATE KIDs 01-Aug-2022 08:13:17 AM
4898 She Sexy 29-Jul-2022 01:03:40 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