Advertisement
WizartCraftCode

Untitled

Apr 15th, 2024
1,220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.67 KB | None | 0 0
  1. //
  2. // Created by merlin on 4/4/2022.
  3. //
  4.  
  5. #ifndef LAB5_LISTS_H
  6. #define LAB5_LISTS_H
  7.  
  8. typedef struct player_s{
  9.     int player_id;
  10.     int player_exp_points;
  11.     struct player_s *next;
  12. } player_node;
  13.  
  14. typedef struct {
  15.     player_node *head;
  16.     player_node *tail;
  17. } list_t;
  18.  
  19. list_t *create_empty_list();
  20. void add_at_head(list_t *list, int player_id, int player_exp_points);
  21. void add_at_tail(list_t *list, int player_id, int player_exp_points);
  22. void insert(list_t *list, int player_id, int player_exp_points);
  23. player_node *find(list_t *list, int target_player_id);
  24. bool delete(list_t *list, int player_id);
  25. void print_list(list_t *list);
  26. #endif //LAB5_LISTS_H
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement