Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void revert(struct node **root) {
- //jednoprvkovy
- if((*root)->next == NULL)
- return;
- //dvoj a viac prvkovy
- struct node *act = *root;
- struct node *previous = NULL;
- struct node *nxt;
- while(act->next != NULL) {
- nxt = act->next;
- act->next = previous;
- previous = act;
- act = nxt;
- }
- *root = act;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement