fork download
  1.  
  2. struct node * sort_ascending(struct node *head){
  3. if(head != NULL){
  4. struct node *first = head;
  5. struct node *move;
  6. struct node *smallest;
  7.  
  8. while(first->next){
  9. smallest = first;
  10. move = first->next;
  11. while(move){
  12. if(smallest->val > move->val){ //ascending
  13. smallest = move;
  14. }
  15. move = move->next;
  16. }
  17. /*int temp = first->val;
  18.   first->val = smallest->val;
  19.   smallest->val = temp;
  20.   first = first->next;*/ //CANNOT BE DONE THIS WAY
  21. }
  22. return head;
  23. }
  24. return head;
  25. }
  26. struct node * insert_middle(struct node *current, int val, int idx){
  27. } //insert into a specific location in the list
  28.  
  29. struct node * remove_node(struct node *current, int val){
  30. } //delete a particular node
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:2: error: class, interface, or enum expected
struct node * sort_ascending(struct node *head){
^
Main.java:5: error: class, interface, or enum expected
        struct node *move;
        ^
Main.java:6: error: class, interface, or enum expected
        struct node *smallest;
        ^
Main.java:8: error: class, interface, or enum expected
        while(first->next){
        ^
Main.java:10: error: class, interface, or enum expected
            move = first->next;
            ^
Main.java:11: error: class, interface, or enum expected
            while(move){
            ^
Main.java:14: error: class, interface, or enum expected
                }
                ^
Main.java:16: error: class, interface, or enum expected
            }
            ^
Main.java:23: error: class, interface, or enum expected
    }
    ^
Main.java:25: error: class, interface, or enum expected
}
^
10 errors
stdout
Standard output is empty