<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 24, 2020 at 12:56 PM Виктория Малясова <<a href="mailto:malyasova.viktoriya@yandex.ru">malyasova.viktoriya@yandex.ru</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hello everyone!</div><div> </div><div>I've implemented the Rivest-Floyd selection algorithm as a second option to the partition method. I found it works about 1.5 times faster on average for big array sizes; here are average times for finding a median:</div><div><pre style="background-color:rgb(255,255,255);border:0px none;border-radius:0px;box-sizing:border-box;color:rgb(0,0,0);font-family:monospace;font-size:14px;font-style:normal;font-weight:400;line-height:inherit;margin:0px;overflow:auto;padding:1px 0px;text-align:left;text-decoration-style:initial;text-indent:0px;text-transform:none;vertical-align:baseline;white-space:pre-wrap;word-break:break-all;word-spacing:0px">array length 10
introselect 4.6e-05
rivest_floyd 4.4e-05
array length 100
introselect 5.5e-05
rivest_floyd 4.7e-05
array length 1000
introselect 6.9e-05
rivest_floyd 6.5e-05
array length 10000
introselect 3.1e-04
rivest_floyd 2.3e-04
array length 100000
introselect 2.9e-03
rivest_floyd 2.0e-03
array length 1000000
introselect 2.9e-02
rivest_floyd 2.0e-02
I've created a pull request <a href="https://github.com/numpy/numpy/pull/17813" target="_blank">https://github.com/numpy/numpy/pull/17813</a> and implemented reviewer's suggestions and fixes. Do you think this feature should be added? I am new to open source, sorry if I am doing anything wrong.</pre></div></blockquote><div><br></div><div>Hi Viktoriya, welcome! It looks like you're doing everything right, and the reviews so far are positive.</div><div><br></div><div>Cheers,</div><div>Ralf</div><div><br></div></div></div>