Question: Convert this pseudocode into an algorithm Algorithm FindMedian ( list ) : if list is empty: return Error ( The list is empty )
Convert this pseudocode into an algorithm Algorithm FindMedianlist:
if list is empty:
return ErrorThe list is empty"
sortedList Sortlist
if Length of sortedList is even:
middleIndex LengthsortedList
middleIndex middleIndex
median sortedListmiddleIndex sortedListmiddleIndex
else:
middleIndex LengthsortedList
median sortedListmiddleIndex
return median
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
