Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started