- I Number Of Valleys Given A List Of N Unique Quantifiable Elements The Number Of Valleys Problem Or Simply Nvl Is To 1 (130.15 KiB) Viewed 56 times
I Number of Valleys Given a list of n unique quantifiable elements, the number of valleys problem, or simply NVL, is to
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
I Number of Valleys Given a list of n unique quantifiable elements, the number of valleys problem, or simply NVL, is to
I Number of Valleys Given a list of n unique quantifiable elements, the number of valleys problem, or simply NVL, is to find the number of elements that are less than the immediate previous element and the previous element must be greater than its previous number. For example, 3 2 7 9 4 1 5 халуух NVL((3, 2, 7, 9, 4,1,5))=2 (a) arbitrary sequence Figure 1: Number of valleys problem examples. 7 5 2 4 3917 7 x 7 NVL((5, 2, 4, 3, 9, 1,7))=3 (b) down-up list The problem is formally defined as follows: Problem 2.X. Number of Valleys (NVL) Input: Output: A sequence A of n unique quantifiable elements n i=3 f(i) where f(i) = 1 if ai-2 ai-1 ^ai-1 < ai 0 otherwise I.1. Derive a first order linear recurrence relation of the problem. I.2. Devise an algorithm using inductive programming. 1.3. Analyze the computational time complexity of your algorithm in b). I.4. Devise an algorithm using the divide and conquer paradigm. I.5. Analyze the computational time complexity of your algorithm in d).