/* ============================================================================ Name : InClass1.c Author : Alex Nelson Version : Copyright : Description : Starter list header file for In-Class Assignment ============================================================================ */ #ifndef LINKEDLIST_H_ #define LINKEDLIST_H_ #include #include //Struct for each node containing an integer value and a pointer //to the next node typedef struct node { int data; struct node *next; } NODE; //Struct for a list container containing the list size and a //pointer to the head node of the list typedef struct list{ int size; NODE *head; } LIST; //Function which creates a new node in dynamic memory //and returns a pointer to the node NODE * CreateNode(int newdata); //Function which creates a new list and returns a pointer //to the list LIST * CreateList(); //Function to insert an integer value at a certain position in //the list void Insert(LIST * myList, int pos, int val); //Function to insert a node in a certain position in the list void InsertNode(LIST * myList, NODE * newdata, int pos); //Function which attempts to delete a node at the given position //returns 0 if deleted successfully, 1 if error int DeleteIndex(LIST * myList, int rmdata); //Function which prints each integer in the list void PrintList(LIST * myList); void DeleteList(LIST* myList); #endif /* LINKEDLIST_H_ */