Question: Tukey's ninthers def tukeys_ninthers (items ) : Back in the day when computers were much slower and had a lot less RAM for our programs

Tukey's ninthers def tukeys_ninthers (items ) : Back in the day when computers were much slower and had a lot less RAM for our programs to work in, special techniques were necessary to achieve things that we can now do with easy couple of lines of code. In this spirit, Tukey's Ninthers is a clever approximation algorithm from the seventies to quickly find the median element of an unsorted list, or at least find some element that is close to the true median with high probability. In this problem, the median element of the list is defined to be the element that would end up in the middle position, were that list actually sorted. The algorithm itself is very simple. Conceptually split the list into sublists of three elements each, and use an if-else ladder of ordinary comparisons to find the median element for each these sublists. Collect these medians of three into a new list (that therefore has one third of the length of the original list), and keep doing the same until only one element remains. (For simplicity, your function can assume that the length of items is always some power of three.) In the following
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
