Answer:
1) Selection, bubble and insertion sort requires no moves in the sorted array because there will be n comparisons in the array and no swapping would take place after each comparison so zero moves.
2) Bubble and insertion sort result in 999 comparisons as we are required to iterate only one time over the array. this can be easily explained from the diagram as in bubble sort all the elements will be in their sorted position so each element will be encountered only once.
3) In selection sort, any element is compared with all the elements and accordingly smaller is paced first so in the reverse sorted array there will be at least n^2 comparisons so n^2 moves.
4) in merge sort an array is always divided into n nos of parts and then sorted so in worst case as well as best case the array will be divided so same numbers of moves.
Answer:
def listSum(mylist):
sum =0
for item in range(0,len(mylist)):
sum=sum+mylist[item]
print(sum)
Explanation:
Using the Python programming language, I defined a function as listSum that accepts a list as a parameter and returns the sum of the elements in the list.
The most important logic here is defining the range of elements in the list not to exceed the length of the list using the len function. Then using a for statement, we loop through each element and add them up to a sum variable initially assigned the value of 0.
This simply means that the cell is not wide enough to be able to show all the contents entered into that cell
Answer: I believe it is the second one or third one
Explanation:
Answer:
Spends more of its time seeking I/O operations than doing computational work.
Explanation:
The I/O bound process are depend on Input and output speed. on the other hand computational work is associated with CPU bound processes. Therefore option "C" is better option for I/O bound processes.