Facebook
From Michaił Kubik, 4 Years ago, written in C.
Embed
Download Paste or View Raw
Hits: 261
  1. //
  2. // Created by kubik on 7 lip 2018.
  3. //
  4. #pragma once
  5. typedef struct node_t {
  6.     int data;
  7.     struct node_t *next;
  8. } Node;
  9.  
  10. typedef struct linked_list_t {
  11.     struct node_t *head;
  12.     struct node_t *tail;
  13. } List;
  14.  
  15. struct linked_list_t *ll_create();
  16.  
  17. int ll_push_back(struct linked_list_t *ll, int value);
  18.  
  19. int ll_push_front(struct linked_list_t *ll, int value);
  20.  
  21. int ll_pop_front(struct linked_list_t *ll, int *err_code);
  22.  
  23. int ll_pop_back(struct linked_list_t *ll, int *err_code);
  24.  
  25. int ll_back(const struct linked_list_t *ll, int *err_code);
  26.  
  27. int ll_front(const struct linked_list_t *ll, int *err_code);
  28.  
  29. struct node_t *ll_begin(struct linked_list_t *ll);
  30.  
  31. struct node_t *ll_end(struct linked_list_t *ll);
  32.  
  33. int ll_size(const struct linked_list_t *ll);
  34.  
  35. int ll_is_empty(const struct linked_list_t *ll);
  36.  
  37. int ll_at(const struct linked_list_t *ll, unsigned int index, int *err_code);
  38.  
  39. int ll_insert(struct linked_list_t *ll, unsigned int index, int value);
  40.  
  41. int ll_remove(struct linked_list_t *ll, unsigned int index, int *err_code);
  42.  
  43. void ll_clear(struct linked_list_t *ll);
  44.  
  45. void ll_display(const struct linked_list_t *ll);

Replies to linked list.h rss

Title Name Language When
Re: linked list.h Mustard Eider c 5 Months ago.
Re: linked list.h Bistre Zebra c 1 Year ago.