I have no experience with Perl. I am trying to write a Perl program that will find the median of an array after an infinite loop that ends when the user inputs a negative number. I have been trying to figure it out for days and am just lost. I can't use anything too fancy so the method an experienced user of Perl may use (being the most efficient method) is probably not right for me. Think back to the basics.
I already have my loop and the numbers are being stored correctly in the array. I even sorted the array already so that the numbers are in ascending order. I just can't wrap my head around how to tell it to look at the middle numbers without knowing beforehand how many numbers will be input into the array.
In reply to Finding Median of an Array after an Infinite Loop by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |