Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorting a linked list

Status
Not open for further replies.

keak

Programmer
Sep 12, 2005
247
0
0
CA
Hi there, I have a structure of the fllowing:

Code:
typedef struct nodes
{
char *text;
int index;
struct nodes *nextphrase
} nodes;

and I have a pointer to this nodes struct that has around 50 items (connected with the nextphrase pointer).

I was wondering if there was a quick way to sort this nodes in alphabetical order (sorting the char *text field).

 
Is this a C program or a C++ program?
If it's a C++ program, it would probably make your life a lot easier if you used STL containers like std::list instead of creating C-style linked lists...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top