I need help with this Problem

Fill in the sort_linked_list function such that you return a new linked list that is sorted from smallest value to largest value. Steps 1 and 5 have been completed for you.

Use the methods in linkedlist.py and node.py to traverse, remove, and get values from the list.

Test cases have been provided for you in order to test your code.

Here is the sorted list function

def sort_linked_list(linked_list):
  print("\n---------------------------")
  print("The original linked list is:\n{0}".format(linked_list.stringify_list()))
  new_linked_list = LinkedList()
  #Write Code Here!
  
  
  return new_linked_list

https://www.codecademy.com/paths/computer-science/tracks/cspath-asymptotic-notation/modules/cspath-asymptotic-notation/lessons/asymptotic-notation-python/exercises/sort-linked-list

Hey @jaccobtw

You might get a bit more help if you said what it was that you were stuck with, rather than simply posting a link to the exercise. Otherwise, it seems like you’re simply asking someone else to give you the solution which somewhat defeats the purpose no? :slight_smile:

2 Likes

Read the part that occurs just before the instruction that you posted above. It is a five-step outline of what you will need to do.

2 Likes