Okay, looking at your Bubble Sort, I noticed a few things:
  • First off, it crashes when the list is empty, i.e. when passed NULL as the head of the list. An empty list occurs very often in practice.
  • safeFirst is unused.
  • What is the result of executing these three statements, and can you see how they would be executed in your function?
    Code:
    plat1 = first;
  • plat3 = first;
  • (*plat3).next = plat1;