Nп/п : 9 из 100
 От   : Hans Bezemer                        2:5075/128        24 сен 23 05:31:00
 К    : Bob Armstrong                                         24 сен 23 15:35:02
 Тема : Re: Order preserving Sort algorithm ?
----------------------------------------------------------------------------------
                                                                                 
@MSGID:
<46fcf01c-16f9-4cfa-8aae-60320889aecdn@googlegroups.com> 79ad52b0
@REPLY:
<b0ac03f1-f64f-4fef-aa9a-f48badb438c6n@googlegroups.com> 10cfd6ed
@REPLYADDR Hans Bezemer
<the.beez.speaks@gmail.com>
@REPLYTO 2:5075/128 Hans Bezemer
@CHRS: CP866 2
@RFC: 1 0
@RFC-References:
<b0ac03f1-f64f-4fef-aa9a-f48badb438c6n@googlegroups.com>
@RFC-Message-ID:
<46fcf01c-16f9-4cfa-8aae-60320889aecdn@googlegroups.com>
@TZUTC: -0700
@PID: G2/1.0
@TID: FIDOGATE-5.12-ge4e8b94
On Saturday, September 2, 2023 at 9:51:16 PM UTC+2, Bob Armstrong wrote:
 > It`s been too long since I checked comp.lang.forth . comp.lang.apl
has too little activity to bother with & I didn`t realize that is far
from true here . 

> Anybody got a good ` sort algorithm ? 
 I got plenty. They come in two flavors, address based and index
based. The address based ones work with any structure, as long as they
exist as pointer arrays. The comparison uses a call back function:

AlgorithmLibrary
Slow sortslowsort.4th
Stooge sortstoosort.4th
Cycle sortcyclsort.4th
Pancake sortpancsort.4th
Radix sort LSBradxsort.4th
Bubble sortbublsort.4th
Cocktail sortcocksort.4th
Cocktail sort
(improved)coc2sort.4th
Simple sortsimpsort.4th
Simple sort
(improved)ismpsort.4th
Selection sortselcsort.4th
Insertion sortinstsort.4th
Insertion sort
(improved)ins2sort.4th
Binary Insertion sortbinssort.4th
Oyelami sort (MDIS)oyelsort.4th
Circle sortcircsort.4th
Circle sort (improved)cir2sort.4th
Bitonic sortbitosort.4th
Merge sortmergsort.4th
Odd-even merge sortodevsort.4th
Tim sort (simple)timsort.4th
Shell sortshelsort.4th
Shell sort (A033622)shelsort.4th
Shell sort (A108870)shelsort.4th
Comb sortcom2sort.4th
Heap sorthea2sort.4th
Binary Quick sortbinquick.4th
Intro sortintrsort.4th
Quick sortqsort.4th
Quick sort
(unsafe)qsort.4th

 The index based ones work with any structure as well, as long as
they`re random accessible (by using an index). Both the compare and the
exchange words are callbacks:

AlgorithmLibrary
Heap sortheapsort.4th
Comb sortcombsort.4th
Selection sortsel2sort.4th
Bubble sortbub2sort.4th
Gnome sortgnomsort.4th
Gnome sort (improved)gno2sort.4th

 They`re written for 4tH, so some assembly may be required. You can
find them here:
https://sourceforge.net/p/forth-4th/code/HEAD/tree/trunk/4th.src/lib/

Hans Bezemer
--- G2/1.0
 * Origin: usenet.network (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх