summaryrefslogtreecommitdiff
path: root/src/01/02a/singly_linked_list.h
blob: 19dd3d7aac267ec38e635e860e4541852e562cd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
 * A node in a linked list.
 */
struct node {
  int data;
  struct node *next;
};

typedef struct node Node;

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