debug code in python | essaywriters4life.com

Implement the Bubblesort Algorithm presented in the lecture slides.

Each time you compare two elements in the array, print out the comparison.

Implement a function compareElements that does the comparison and also prints.

An example execution trace is given below.

Bubble Sort Test Question_x000D_
Enter Seed for Testing:_x000D_
10_x000D_
Enter Test Size:_x000D_
3_x000D_
Bubble Sorting List_x000D_
Initial List: [36, 2, 27]_x000D_
Compare 36 to 2_x000D_
Compare 36 to 27_x000D_
Compare 2 to 27_x000D_
Compare 27 to 36_x000D_
Final List: [2, 27, 36]_x000D_

You may add helper functions to the below starter file.

If you do not follow the lecture slides, your code may not pass the below tests. Even it it sorts correctly, it will be marked wrong.

Implement the Insertion Sort Algorithm presented in the lecture slides.

Each time you compare two elements in the array, print out the comparison.

An example execution trace is given below.

Insertion Sort Test Question_x000D_
Enter Seed for Testing:_x000D_
5_x000D_
Enter Test Size:_x000D_
3_x000D_
Insertion Sorting List_x000D_
Initial List: [39, 16, 47]_x000D_
Compare 39 to 16_x000D_
Compare 39 to 47_x000D_
Final List: [16, 39, 47]_x000D_

You may add helper functions to the below starter file.

If you do not follow the lecture slides, your code may not pass the below tests. Even it it sorts correctly, it will be marked wrong.

Implement the Merge Sort Algorithm presented in the lecture slides.

Each time you compare two elements in the array, print out the comparison.

An example execution trace is given below.

Merge Sort Test Question_x000D_
Enter Seed for Testing:_x000D_
10_x000D_
Enter Test Size:_x000D_
6_x000D_
Merge Sorting List_x000D_
Initial List: [36, 2, 27, 30, 36, 0]_x000D_
Compare 2 to 36_x000D_
Compare 27 to 2_x000D_
Compare 27 to 36_x000D_
Compare 36 to 30_x000D_
Compare 0 to 30_x000D_
Compare 0 to 2_x000D_
Compare 30 to 2_x000D_
Compare 30 to 27_x000D_
Compare 30 to 36_x000D_
Compare 36 to 36_x000D_
Final List: [0, 2, 27, 30, 36, 36]_x000D_

You may add helper functions to the below starter file.

If you do not follow the lecture slides, your code may not pass the below tests. Even it it sorts correctly, it will be marked wrong.

Implement the Quick Sort Algorithm presented in the lecture slides.

Each time you compare two elements in the array, print out the comparison.

An example execution trace is given below.

Quick Sort Test Question_x000D_
Enter Seed for Testing:_x000D_
10_x000D_
Enter Test Size:_x000D_
4_x000D_
Quick Sorting List_x000D_
Initial List: [36, 2, 27, 30]_x000D_
Compare 36 to 30_x000D_
Compare 2 to 30_x000D_
Compare 27 to 30_x000D_
Compare 2 to 27_x000D_
Final List: [2, 27, 30, 36]_x000D_

You may add helper functions to the below starter file.

If you do not follow the lecture slides, your code may not pass the below tests. Even it it sorts correctly, it will be marked wrong.

 

Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code “Newclient” for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

"Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!":

Get started