Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include "linked_list.h"
  2.  
  3. void main()
  4. {
  5. linked_list liste = empty_linked_list();
  6.  
  7. append(&liste, "1");
  8. append(&liste, "3");
  9. append(&liste, "4");
  10. insert(&liste, "0", 0);
  11. insert(&liste, "2", 2);
  12. insert(&liste, "5", 5);
  13. printf("%d\n", index_of(&liste, "0"));
  14. printf("%d\n", index_of(&liste, "5"));
  15. printf("%d\n", index_of(&liste, "4"));
  16. printf("%d\n", delete(&liste, 3));
  17. printf("%d\n", delete(&liste, 55));
  18. printf("%d\n", index_of(&liste, "3"));
  19. printf("%d\n", index_of(&liste, "4"));
  20. printf("%d\n", index_of(&liste, "5"));
  21. printf("%d\n", delete(&liste, 0));
  22. printf("%d\n", index_of(&liste, "0"));
  23.  
  24. visit_all(&liste, &work);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement