jgamble / Algorithm-Networksort

Release history of Algorithm-Networksort
https://metacpan.org/release/Algorithm-Networksort
Other
13 stars 4 forks source link

nw_sort now also returns how many swaps it made during the sort #4

Closed hoytech closed 12 years ago

hoytech commented 12 years ago

This was useful for creating the following slides in my presentation:

http://hoytech.github.com/sorting-networks/#slide29 http://hoytech.github.com/sorting-networks/#slide30

jgamble commented 12 years ago

I'm going to take the suggestion but alter the form. There will be a new function that I'm tentatively calling nw_sort_stats(), which will return the swap count that you want, but also any other pieces of information that may be thought of later (suggestions welcome).

This leaves the return value of nw_sort() unchanged.