シュワルツ変換
出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2021/06/16 02:56 UTC 版)
シュワルツ変換(シュワルツへんかん、英: schwartzian tranaform)は、リストの要素のソートを効率良く行うためのプログラミングの手法の一つである。 このイディオム[1] は、要素の順序が実際には要素のあるプロパティ(キー)の順序に基づいていて、キーの計算に多くの計算資源を要するため計算回数を最小限にしたい状況で行う比較ソートに適している。シュワルツ変換の特徴として、名前付きの一時配列を使わないことが挙げられる。
- ^ Martelli, Alex; Ascher, David, eds (2002). “2.3 Sorting While Guaranteeing Sort Stability”. Python Cookbook. O'Reilly & Associates. p. 43. ISBN 0-596-00167-3 . "This idiom is also known as the 'Schwartzian transform', by analogy with a related Perl idiom."
- ^ Schwartz, Randal L. (16 December 1994). "Q: sort on last word in field/record". Newsgroup: comp.unix.shell. 2021年6月10日閲覧。
- ^ Cristiansen, Tom (7 December 1996). "Ques: Use of "[ ]" in map". Newsgroup: comp.lang.perl.misc. 2021年6月10日閲覧。
- ^ "The Old Way Using Decorate-Sort-Undecorate". 2021年6月14日閲覧。
- ^ "Module: Enumerable (Ruby 3.0.1)". 2021年6月16日閲覧。
- 1 シュワルツ変換とは
- 2 シュワルツ変換の概要
- 3 Perl
- 4 歴史
- 5 他言語との比較
- シュワルツ変換のページへのリンク