Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Finding Median of an Array after an Infinite Loop
by haukex (Archbishop) on Nov 27, 2019 at 19:21 UTC | |
|
Re: Finding Median of an Array after an Infinite Loop
by BillKSmith (Monsignor) on Nov 27, 2019 at 21:07 UTC |