I have a linked list with string and int content.i can do operations on it like deleting,adding updating or printing etc.. the problem is i need to print them with respect to their numbers in descending order. Right now im adding new nodes to end of list so it prints old to new.
Should i sort them while adding or printing ? i guess i should sort them in adding function.i added comments possible place to do sorting.code is below
Sort Linked List then print
Should i sort them while adding or printing ? i guess i should sort them in adding function.i added comments possible place to do sorting.code is below
Code:
//list.h content struct node{ std::string...