How do I sort a linked list of structures by one of the fields?

前端 未结 4 2015
孤城傲影
孤城傲影 2021-01-15 08:24

Wow now i know I dont. Lol.

I\'ve got my structure like this:

struct Medico{ 
int Id_Doctor;
int Estado;
char Nombre[60]; ////focus on this part of t         


        
4条回答
  •  广开言路
    2021-01-15 09:06

    Sounds like you want to look at implementations of either quicksort or mergesort. I believe that the c std lib qsort implementation takes an array and not a linked list, so you may need to implement your own (although I'm pretty sure that you could find a readily available implementation on the interwebz if you did a quick search)

提交回复
热议问题