I'm trying to make a function that orders me a list of this type, so far I made one that orders a double list but I do not know how to change it so that it does what I want
This is the code of my function:
void ordena_lista(Nodo *nodo){
Nodo *actual, *siguiente;
int n;
actual = nodo;
while(actual->sig != NULL) {
siguiente = actual->sig;
while(siguiente != NULL) {
if(actual->num < siguiente->num) {
n = siguiente->num;
siguiente->num = actual->num;
actual->num = n;
}
siguiente = siguiente->sig;
}
actual = actual->sig;
siguiente = actual->sig;
}
}