summaryrefslogtreecommitdiff
path: root/src/01/02b/doubly_linked_list.h
blob: 5a44ae3bde35568876688ac62ded4a48753e732a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct node {
  int data;
  struct node *next;
  struct node *prev;
};

typedef struct node Node;

Node *initialize(int data);
Node *add(Node *head, int data);
Node *get(Node *from, int index);
void swap(Node *x, Node *y);
Node *reverse(Node *head);
void inspect(Node *node);