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

typedef struct node Node;
typedef void (Visitor)(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);