Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a report detailing the following: The definition of an algorithm Your definition should refer to the bubble sort example in fig. A below when
Write a report detailing the following:
The definition of an algorithm
Your definition should refer to the bubble sort example in fig. A below when explaining.
The process involved in building an application
The technical steps involved in the generation of code, from editing through compiling to
execution.
Analysis of the process of writing code, including the potential challenges faced.
An evaluation of the two implementations of the bubble sort algorithm given in appendices A Appendix A is attached in screenshot
and B considering aspects such as efficiency of implementation, coding standards and the
relationship between the algorithm fig A and the code variants.
Fig A:
begin BubbleSortarray
for all elements of array
if arrayi arrayi
swaparrayi arrayi
end if
end for
return array
End BubbleSort
Appendice A is attached in screenshot
Appendice B:
L
printOriginal List:
printL
forj inrange:
fori inrange:
ifLiLi:
Li Li Li Li
print
Sorted List:
printLAppendix A
Flenane: bubblesortfunctions.py
Author: Bob
Date:
Description: This nodule contains definitions of functions
dedicated to sorting algorithe inplenentations
def swap :
return
def bubbesortnuast: # accepts a st of numbers and sorts then in ascending order
noofpassesennumilst
swappedFalse
for in range noofpasses:
for in range noof passes:
If nunist snum st:
nunst numstswapnumist numst
siwappedTrue
If no swapping takes place in one conplete pass,
all values are in order and sorting stops
if swappedmFalse:
return
Filenawe: bubblesortappondixApy
Author: Bob
Date: ee
Description: testbed file for sorting algorithes exercise
fron bubblesortfunctions nport
def main :
st
printOrginal List:"
printst
bubblesortst
print
Sorted List:"
printst
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started