Vai al contenuto

Programmare con Python

Sezione di VALCON.IT

  • LINGUAGGIO
    • fractions
    • math
    • random
    • statistics
    • turtle –>
  • APPLICAZIONI
    • APPLICAZIONI – 1
    • APPLICAZIONI – 2
    • APPLICAZIONI – 3
    • COMPETIZIONI
    • Abstract Data Type
    • Algebra lineare
    • Calcolo combinatorio
    • Calcolo delle pr. e st.
    • Calcolo numerico
    • datetime-fractions-string
  • >>>
    • gtts
    • matplotlib
    • numpy
    • pandas
    • prettytable
    • pygame –>
    • seaborn
    • sympy
    • vpython –>

Insertion sort

28/02/202527/02/2025 di admin

Vedi la discussione


Una possibile codifica

def insertion_sort(lista):
    n = len(lista)
    for i in range(1, n):
        temp = lista[i]
        j = i-1
        while(j >= 0) and (lista[j] > temp):
            lista[j+1] = lista[j]
            j -= 1
        lista[j+1] = temp
Categorie Applicazioni
Lanciare un dado – 2
Ripetizioni con intervallo

Ultime pagine

  • Permutazioni con ripetizione
  • Permutazioni semplici
  • Numeri
  • F-string
  • Lo struzzo Simone

Moduli

cmath collections datetime fractions gtts math matplotlib numpy pandas prettytable random re seaborn statistics sympy this time tkinter __future__

Categorie

  • Abstract Data Type (11)
  • Analisi dei dati (8)
  • Applicazioni (190)
  • Didattica (8)
  • Linguaggio (86)

Info

Valentino Condoluci
VALCON.IT
© 2025 Programmare con Python • Creato con GeneratePress