Skip to content

Instantly share code, notes, and snippets.

@raju249
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raju249/24d85a43912cd2b2e644 to your computer and use it in GitHub Desktop.
Save raju249/24d85a43912cd2b2e644 to your computer and use it in GitHub Desktop.
A linked list in C
// This is the code for linked list in C.
// This includes functions for insert,delete,search and traverse
// I used the distribution code from my course CS50 by Porf.David.J.Malan
#include <cs50.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
// Defines a node for linked list
typedef struct node
{
int n;
struct node* next;
}
node;
// linked list
node* first = NULL;
// prototypes
void delete(void);
void insert(void);
void search(void);
void traverse(void);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment