Alex Rivera | Logout

Finding the median value of an array?

Asked 2010-09-11T17:33:24.143
14

I was wondering if it was possible to find the median value of an array? For example, suppose I have an array of size nine. Would it possible to find the middle slot of this array?

Edit
Report

1 Answer

2

In C++, you can use std::nth_element; see http://cplusplus.com/reference/algorithm/nth_element/.

answered 2010-09-11T17:36:22.653

Your Answer