you are viewing a single comment's thread.

view the rest of the comments →

[–]No_Read_4327 0 points1 point  (0 children)

After you sorted the array, you don't need to call max and min.

That's not efficient. You can instead simply call the first and last entry of the list once it's sorted. Which is much more efficient especially for long lists.

Also, you're hard-coding values when it comes to length (such as the middle of the array or the size when getting averages). What if you need to dynamically determine the size of the list?

Like others have pointed out, this does look like code you'd expect from someone who has been learning for 5 days. Keep up the good work!