Smoothsort: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Addbot (discussione | contributi)
m migrazione automatica di 6 collegamenti interwiki a Wikidata, d:q1714823
Botcrux (discussione | contributi)
m Bot: sostituisco {{Infobox Algoritmo}} con {{Algoritmo}} (vedi discussione)
Riga 1:
{{Infobox Algoritmo
|class=[[Algoritmo di ordinamento]]
|image=[[Image:Smoothsort.gif|none|Lo Smoothsort durante l'ordinamento di una lista già abbastanza ordinata ma con qualche elemento fuori sequenza.]]
Riga 40:
* If the last two heaps of the string are not consecutive Leonardo numbers, then the rightmost element becomes a new heap of size 1. This 1 is taken to be L(1), unless the rightmost heap already has size L(1), in which case the new one-element heap is taken to be of size L(0).
 
After this, the heap and string properties must be restored. To do this,
 
# the rightmost heap (the one that has just been created) becomes the "current" heap
Riga 70:
==Java implementation==
 
This code uses '''lo''' and '''hi''' as the bounds of the array ''inclusive''. Note that this is not the usual convention.
 
<source lang="java5">
Riga 235:
 
{{ordinamento}}
 
[[Categoria:Algoritmi di ordinamento]]