News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Sorting with animation

Started by Mikl__, December 30, 2022, 09:02:57 AM

Previous topic - Next topic

Mikl__


HSE

Equations in Assembly: SmplMath

jj2007

Quote from: Mikl__ on January 18, 2023, 12:49:21 AM
Fifth part

Hi Mikl,

Sounds good but I can't see an animation, and the "translated" zip archive isn't found... :sad:

QuoteA multiple run through the array is performed, neighboring elements are compared and, if necessary, swapped. When the end of the array is reached, the direction is reversed. While moving to the beginning of the array, we find the maximum element and change it with the element that is at the end of the array. This pushes the minimum element to the beginning of the array. While moving to the end of the array, we find the minimum element and change it with the element that is at the beginning of the array. In this case, the maximum element is pushed to the end of the array. Thus, simultaneously during one pass, the maximum and minimum elements of the end and beginning of the array are filled.

https://en.wikipedia.org/wiki/Cocktail_shaker_sort

HSE

Hi JJ!

Just now I realise how was that:

https://wasm.in/threads/sortirovki-s-animaciej.34674/page-5
Equations in Assembly: SmplMath

zedd151

lol. I had never heard of that sorting algorithm before (cocktail shaker sort). But I once made a sorting algorithm that I called a bidirectional sort which worked very similarly (reversing direction, etc)  if not very slowly.  :biggrin: 
Nice graphic of its implementation. Thankfully I had stopped experimenting with home brew sorting algos in favor of tried and trued methods, which of course are always much faster than anything I could dream up. It was fun though.

jj2007

Quote from: HSE on January 18, 2023, 01:46:28 AM
Hi JJ!

Just now I realise how was that:

https://wasm.in/threads/sortirovki-s-animaciej.34674/page-5

Thanks, Hector, works like a charm :thumbsup:

Mikl__

QuoteSounds good but I can't see an animation, and the "translated" zip archive isn't found...
Hi jj2007!
This is especially for you!

jj2007


Mikl__


jj2007


Mikl__


Mikl__


Mikl__


Mikl__


Mikl__