Can you tell me more how to sort on the key.
my last name, first name can be 10 characters each. and age 3 digits.
I understand that i concatenate the 3.
lastname+firstn ame+age
and that would go to 23 characters. But how do i sort them. for the missing characters i put Space . like if last name is of 5 chars. I put 5 spaces before concatenating the first name.
But how do i sort them.
User Profile
Collapse
-
Each struct has a last name, first name and age.
Punctuation be different. O'Reilly and oreilly be different.
Comparisons be case-sensitive.
I m more concerned in making it efficient , I can do it my way. But I need to have an efficient data structure use.
I have all the records in a linked list. And it will contain around 1000's of nodes.
So how to sort them is a major concern to me. Do...Leave a comment:
-
Sorting a linked list of structs on multiple parameters.
Hi
I have a linked list of struct.
with fields last name, first name, age
I want to sort this linked list based on the parameter provided by the user.
If the user provides last name, i want that list be sorted by last name. If 2 or more people have same last name then it be sorted by their first name, and if first names are also same for any then by age.
Same for first name sorting. initial...
No activity results to display
Show More
Leave a comment: