Rearrengement of a singly linked list

This is the example that shows how to rearrange nodes of a singly linked list. The list stores data about students (name and grade). List is not sorted. In the example, the function „addToList“ adds new elements at the beginning of the list. 
For the given list, the task is to rearrange list nodes according to the given grade. The rearrangement must be done in the following way:
All nodes containing grades larger than or equal to the given grade must be on left side of the list, while all other nodes must be on the right side of the list. Nodes on the left side of the list must be in the same order as in the original appearances, while nodes on the right side must be in the order reverse to the original order. This is done in the function „rearrangeList“.

For example, if the given list is, and the given grade for rearrangement is 3:
         
Ann:5 --> Emma:1 --> Ian:5 --> John:3 --> Ada:4 --> Amy:2-->NULL

After the list rearrengement: 

Ann:5 --> Ian:5 --> Ada:4 --> Amy:2 --> John:3 --> Emma:1 --> NULL