1. Engineering
  2. Computer Science
  3. 125 suppose a list of values is given such that...

Question: 125 suppose a list of values is given such that...

Question details

1·25%) Suppose a list of values is given such that you do not know the the number n of items in the list but are instead told that the list is terminated by value -1. An example of such a list is [3,2,5,1,4,-1 Give in pseudocode a modification to Version 2 of the Sequential List Search algorithm in the Algorithms lecture slides which allows the al. gorithm to determine if the requested value X is in a -1-terminated list 2. [25%) Give in pseudocode a modification to Version 1 of the Selection Sort algorithm in the Algorithms lecture slides which allows the algo- rithm to sort the given list L in descending rather than ascending order. For example, given a list [3,2,5,1], the algorithm should compute the result [5,3,2,1] 3. 50% Given a list L of n numbers, the Arc Average AA(L) of L is equal to the sum of the absolute values of the elements of L divided by the number of elements in L, i.e., (Ση! Lil)/n. One can then define the Woon era Coefficient WC(L) ass:-1 (Li-AA(L))2. For example, given a list L 2,-4,3,0,11], AA(L) (243+0+11)/5 20/5 4 and WC(L) (2-4)2 + (-4-4)2 + (3-4) + (0-4)2 + (11-4)2 = 464 +1+16 + 49 I 34 Write an algorithm, described in pseudocode, that computes the Woomera Coefficient of a given list L of n numbers

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution