So my assignment is removing elements, int type in a linked list, to make them in order of ascending.
So for example:
header -> 2 -> 1 -> 1 -> 4 -> 3 -> 6
I have to traverse the list and remove 1, 1, 3 to get 2 -> 4 -> 6.
I completed the assignment and ran on sample linked lists the professor gave to validate our codes. They correct, but I think if the linked list is longer, my way of doing it would be incorrect.
I just want to ask if you guys know any other ways to do this. Just asking for how... I can do the coding myself. I cant post my code on here since the program is still not yet due, and my classmate could look up the web...
So for example:
header -> 2 -> 1 -> 1 -> 4 -> 3 -> 6
I have to traverse the list and remove 1, 1, 3 to get 2 -> 4 -> 6.
I completed the assignment and ran on sample linked lists the professor gave to validate our codes. They correct, but I think if the linked list is longer, my way of doing it would be incorrect.
I just want to ask if you guys know any other ways to do this. Just asking for how... I can do the coding myself. I cant post my code on here since the program is still not yet due, and my classmate could look up the web...