Code:
void Sort()
	{
	node* first;
	node* second;
	node* temp;
	
	first=head;
		
		while(first->next!=NULL)
		{
			second=first->next;
			while(second->next!=NULL)
			{
		
				if(first->data < second->data)
				{
					temp = new node;
					temp->data=first->data;
					first->data=second->data;
					second->data=temp->data;
					delete temp;
				}
			second=second->next;
			}
			
		first=first->next;
		}
	}
This is the sorting function for the singly linked list , but it does not sort the list . Plus i want to know if there is another better way?