Advertisement
Guest User

singly_linked_list.h

a guest
Oct 21st, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. /*
  2. * singly_linked_list.h
  3. *
  4. * Created on: Oct 16, 2019
  5. * Author: Bojan Rikic RA134/2016
  6. */
  7.  
  8. #ifndef SINGLY_LINKED_LIST_H_
  9. #define SINGLY_LINKED_LIST_H_
  10.  
  11. #include <stdio.h>
  12. #include <stdint.h>
  13. #include <stdlib.h>
  14. #include <inttypes.h>
  15. #include <stdbool.h>
  16. #include <assert.h>
  17.  
  18.  
  19. typedef struct node
  20. {
  21. int_least8_t value;
  22. struct node* next;
  23. } Node;
  24.  
  25.  
  26. typedef struct list
  27. {
  28. Node* head;
  29. } List;
  30.  
  31.  
  32. Node* create_node(int_least16_t new_value);
  33.  
  34. List* make_list(void);
  35.  
  36. void push_begin(List* singly_linked_list , int_least16_t n);
  37.  
  38. void push_end(List* singly_linked_list, int_least16_t n);
  39.  
  40. void print_list(const List* singly_linked_list);
  41.  
  42. int_least16_t pop_last(List* singly_linked_list);
  43.  
  44. void clear_list(List* singly_linked_list);
  45.  
  46. void split_list(const List* singly_linked_list, List* list_with_even_index ,List* list_with_odd_index);
  47.  
  48. void insert_in_list(const List* singly_linked_list, const Node *position,int_least16_t n);
  49.  
  50. #endif /* SINGLY_LINKED_LIST_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement