Skip to content

Instantly share code, notes, and snippets.

@irrationnelle
Created October 28, 2015 17:55
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 irrationnelle/198672f718a2c18bcf98 to your computer and use it in GitHub Desktop.
Save irrationnelle/198672f718a2c18bcf98 to your computer and use it in GitHub Desktop.
#ifndef LINKEDLIST_H // To avoid repeating header declaration
#define LINKEDLIST_H // With this line, codes can be valid from 3 to 26
#include <stdio.h>
#include <stdlib.h>
typedef int ElementType;
typedef struct tagNode
{
ElementType Data;
struct tagNode *NextNode;
} Node;
/** Declaration for Basic Function Forms
IMPORTANT; Skip 'extern' for Basic Fuction Forms **/
Node* SLL_CreateNode(ElementType NewData);
void SLL_DestroyNode(Node* Node);
void SLL_AppendNode(Node** Head, Node* NewNode);
void SLL_InsertAfter(Node* Current, Node* NewNode);
void SLL_InsertHead(Node** Head, Node* NewHead);
void SLL_RemoveNode(Node** Head, Node* Remove);
Node* SLL_GetNodeAt(Node* Head, int location);
int SLL_GetNodeCount(Node* Head);
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment