1. Explore the process of one of the following Algorithms (each group must be assigned a different function by the cours

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

1. Explore the process of one of the following Algorithms (each group must be assigned a different function by the cours

Post by answerhappygod »

1 Explore The Process Of One Of The Following Algorithms Each Group Must Be Assigned A Different Function By The Cours 1
1 Explore The Process Of One Of The Following Algorithms Each Group Must Be Assigned A Different Function By The Cours 1 (25.11 KiB) Viewed 82 times
Discrete math
Please answer question 1.1 and 1.2. for 1.1 show me the
steps.
1. Explore the process of one of the following Algorithms (each group must be assigned a different function by the course teacher): • Shell Sort algorithm is a sorting algorithm. 1.1 Calculate the total number of steps required by the algorithm and express it as a function of n (f(n)) (1 Mark) 1.2 Determine the Time complexity of the algorithm using Big-o notation. (1 Mark) Note: Appendix - Part 3 contains the Python code of the algorithms. Algorithm 4 - Shell Sort algorithm in Python: def ShellSort(L): len(L) // 2 # dividing the number of elements by 2 to find th le gap while g > 0: for i in range(g, len(L)): y = L Z = I while z >= g and [z - g] > y: L[z] - Yz - g] Z -= 8 L[2] = y g //= 2 mylist = [23, 12, 1, 17, 45, 2, 13] ShellSort( mist) #calling the function print(mvlist)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply