Guest User

Untitled

a guest
Apr 5th, 2014
98
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <assert.h>
  4. #include <string.h>
  5.  
  6. typedef struct linked_list linked_list;
  7. typedef struct cons cons;
  8. /* cons is the Racket equivalent of Lisp's car */
  9. struct cons {
  10.   int value;
  11.   cons *next;
  12. };
  13.  
  14. struct linked_list {
  15.   int size;
  16.   cons *list;
  17. };
  18.  
  19. void linked_list_append(linked_list *ll, int value);
  20. int size(linked_list *ll);
  21. void linked_list_insert_after(linked_list *ll, int value, int index);
  22. void linked_list_delete_at(linked_list *ll, int index);
  23. linked_list *new_linked_list(void);
  24. void linked_list_destroy(linked_list *ll);
  25. int linked_list_get(linked_list *ll, int index);
  26. void linked_list_print(linked_list *ll);
RAW Paste Data