Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void mid_elem(node_t *list)
- {
- node_t *simple = list;
- node_t *twice = list;
- while(twice && twice -> next)
- {
- simple = simple -> next;
- twice = twice -> next -> next;
- }
- printf("MIDDLE IS %d", simple -> data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement