Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

list = { 2, 8, 3, 2, 9, 8, 6, 3, 4, 6, 1, 9 } where n = 12. List elements are nu

ID: 3878320 • Letter: L

Question


list = { 2, 8, 3, 2, 9, 8, 6, 3, 4, 6, 1, 9 }
where n = 12. List elements are numbered starting at 0. We define a run up to be a (k+1)-length subsequence listi, listi+1,
listi+2, ..., listi+k, that is monotonically increasing (i.e., listi+j listi+j-1 for each j = 1, 2, 3, ..., k). Similarly, a run down
is a (k+1)-length subsequence listi, listi+1, listi+2, ..., listi+k, that is monotonically decreasing (i.e., listi+j-1 listi+j for each
j = 1, 2, 3, ..., k). For the above example list we have these runs up and runs down:
Runs Up
list0 through list1 = { 2, 8 }; k = 1
list2 = { 3 }; k = 0

Explanation / Answer

runs up list are: //increasing sequences

list0 ={2,8}

list3={2,9}

list7={3,4,6]

list10={1,9}

runs down list://decreasing sequences

list1 = {8,3,2}

list4={9,8,6,3}

list9 = {6,1]