Beh ... puoi utilizzare l'algoritmo senza la funzione, ma devi fare attenzione ad adattarlo al tuo problema (tu hai un array di strutture ...).