Given an array of different integers, replace each element by its corresponding descending order in the array. The maximum array element has the order 1; the second maximum element has order 2, and so on... For example, Input: 10, 12, 17, 14, 8, 3, 22} Output: {5, 4, 2, 3, 6, 7, 1} and analyse the a) Design a brute-force algorithm to solve this problem complexity of your solution b) Design a more efficient algorithm to do the same task with less complexity and analyse the complexity of your solution. c) Develop a python code to implement your efficient algorithm. ( depend on the correctness of the code, indentation, comments, test-casel d) Prepare a brief report (250 words) comparing the two algorithms
Given an array of different integers, replace each element by its corresponding descending order in the array. The maximum array element has the order 1; the second maximum element has order 2, and so on... For example, Input: 10, 12, 17, 14, 8, 3, 22} Output: {5, 4, 2, 3, 6, 7, 1} and analyse the a) Design a brute-force algorithm to solve this problem complexity of your solution b) Design a more efficient algorithm to do the same task with less complexity and analyse the complexity of your solution. c) Develop a python code to implement your efficient algorithm. ( depend on the correctness of the code, indentation, comments, test-casel d) Prepare a brief report (250 words) comparing the two algorithms
Related questions
Question
solve
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 2 images