Programming-Problem-solving-by-using-python-language

Programming-Problem-solving-by-using-python-language

Create a function that will generate a list of random numbers. Be sure the numbers are in random order. The function should accept a number that represents the size of the list and return the list. Modify the Insertion sort, Select sort and Merge sort functions to perform benchmark analysis on each of these functions. You can use some type of counting such as comparisons and /or swaps or you could use time. These files are mentioned:

Insertion sort:

def insertionSort(alist):
for index in range(1, len(alist)):
currentValue = alist[index]
position = index
while position > 0 and alist[position – 1] > currentValue:
alist[position] = alist[position – 1]
position -= 1
alist[position] = currentValue

Selection sort:

def selectionSort(alist):
for fillslot in range(len(alist) – 1, 0, -1):
positionOfMax = 0
for location in range(1, fillslot + 1):
if alist[location] > alist[positionOfMax]:
positionOfMax = location
temp = alist[fillslot]
alist[fillslot] = alist[positionOfMax]
alist[positionOfMax] = temp

Merge sort:

def mergeSort(alist):
if len(alist) > 1:
mid = len(alist) // 2
lefthalf = alist[:mid]
righthalf = alist[mid:]
mergeSort(lefthalf)
mergeSort(righthalf)
i = 0
j = 0
k = 0
while i < len(lefthalf) and j < len(righthalf):
if lefthalf[i] < righthalf[j]:
alist[k] = lefthalf[i]
i = i + 1
else:
alist[k] = righthalf[j]
j = j + 1
k = k + 1
while i < len(lefthalf):
alist[k] = lefthalf[i]
i = i + 1
k = k + 1
while j < len(righthalf):
alist[k] = righthalf[j]
j = j + 1
k = k + 1

Note: Run the benchmark analysis on each sorting function for list sizes of 100, 1000, and 10000. Print the size and the benchmark values (time or counts). Please use Python language

Part2: Use the binaryList. You will need to read the numbers into a list. Run a for loop 20 times searching for the 20 numbers locationed in the binaryLook.txt file. Analyze these searched using comparison.

part-3: Use the hashList.txt file (mentioned in the below). Using the hash search (mid-square method), move the numbers from the file to a hash list. Suggested size for the hash list is 1171. Once the list is created, use the hash function to search for 20 numbers founds in the hashLook.txt file. Analyze these searches using comparison. Write an essay completely explaining the two search methods.

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational