Question: 2.1 [15 points] Design an algorithm with O(nlogn)-time complexity to find the longest monotonically increasing subsequence of n numbers Write your pseudocode in the following
![2.1 [15 points] Design an algorithm with O(nlogn)-time complexity to find](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66e2b061d7260_32166e2b0617541e.jpg)
2.1 [15 points] Design an algorithm with O(nlogn)-time complexity to find the longest monotonically increasing subsequence of n numbers Write your pseudocode in the following format. Explain why your algorithm is O(nlogn) - e.g. Which line takes O(n) and which line takes O(logn) eto. Algorithm Longest-Mono-Increasing-SubseQ-VER2 Input Output Line 1 Line 2: Line 3: Line 4: 2.2 [10 points] Implement your algorithm in a programming language of your choice 2.3 [5 points] Show 5 randomly generated lists of 10 elements and the result returned by your algorithm 2.4 [5 points] Use the randomly generated 100 lists of 10 elements in your Question 1, compare the total time used for this algorithm with that of the algorithm Longest-Mono-Increasing-SubseQ-VER1 2.3 [5 points] Use the randomly generated 100 lists of 100 elements in your Question 1, compare the time used for this algorithm with that of the algorithm Longest-Mono-Increasing-SubseQ-VER1 2.4 [5 points] Use the randomly generated 100 lists of 104 elements in your Question 1, compare the time used for this algorithm with that of the algorithm Longest-Mono-Increasing-SubseQ-VER1 2.5 [5 points] Use the randomly generated 100 lists of 10s elements in your Question 1, compare the time used for this algorithm with that of the algorithm Longest-Mono-Increasing-SubseQ-VER1. If your computer runs out of memory, please state so 2.1 [15 points] Design an algorithm with O(nlogn)-time complexity to find the longest monotonically increasing subsequence of n numbers Write your pseudocode in the following format. Explain why your algorithm is O(nlogn) - e.g. Which line takes O(n) and which line takes O(logn) eto. Algorithm Longest-Mono-Increasing-SubseQ-VER2 Input Output Line 1 Line 2: Line 3: Line 4: 2.2 [10 points] Implement your algorithm in a programming language of your choice 2.3 [5 points] Show 5 randomly generated lists of 10 elements and the result returned by your algorithm 2.4 [5 points] Use the randomly generated 100 lists of 10 elements in your Question 1, compare the total time used for this algorithm with that of the algorithm Longest-Mono-Increasing-SubseQ-VER1 2.3 [5 points] Use the randomly generated 100 lists of 100 elements in your Question 1, compare the time used for this algorithm with that of the algorithm Longest-Mono-Increasing-SubseQ-VER1 2.4 [5 points] Use the randomly generated 100 lists of 104 elements in your Question 1, compare the time used for this algorithm with that of the algorithm Longest-Mono-Increasing-SubseQ-VER1 2.5 [5 points] Use the randomly generated 100 lists of 10s elements in your Question 1, compare the time used for this algorithm with that of the algorithm Longest-Mono-Increasing-SubseQ-VER1. If your computer runs out of memory, please state so
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
