My CODE looks like that, but, for example i enter values 1, 5, 4, 10 -> i suppose to see out -> 1, 4, 5 10, but i see just -> 1, 5, 10
Code:
class klase {
      struct elementi {
                      int value;            //value of node
                      elementi *next;
                      };
      elementi *current, *last, *first;
      public :
             klase(){last = current = first = NULL;}                        
             ~klase() { izdzest(); };
           
void sort(){
     elementi *temp = first, *next, *t1, *t2;

     for(next = temp->next; next !=NULL; next = temp->next){
              next=temp->next;
          if(temp->value > next->value) {

          if(next!=last){
            t1=temp;
            t2=next;
            t1->next=next->next;
            temp=t2;
            next=t1;}

         else { t1=temp;
             t1->next=NULL;
             t1=last;
             temp=temp->next;
             temp->next=t1; }}
         else {  
           temp = temp->next; }}
};