It's a library in simplest type of linked list
This library is one of the libraries belonging to Data Structure in particularly Singly linked list in which every node contains some data and a pointer to
the next node of the same data type.
- This library contains a lot of useful and easily used functions such as:
-
CreateList(&List) :
This function take the address of the list of type of struct List_t to create your list which point to the 1st node in your list -
AddToFront(&list,Value) :
This function enables you to add items at the beginning of the list, note when you add from front the first value you add becomes the last value in the list -
RemoveFromFront(&List,&Retern Data):
This function make you able to remove the last data you add from the front of the list. -
AddToBack(&List,Value) :
This function enables you to add items at the end of the list, note when you add from back, the first value becomes the first item in the list and the last value is the last item in the list. -
RemoveFromBack(&List,&Retern Data) :
this function make you able to remove the last data you add from the back of the list.
- There is fundamental user defined data type you should know them:
- struct list/List_t which contain the address that point to the first node in the list at all.
- struct node/Node_t which contain the value will be added in and pointer that is point to the next node in the list.
- These functions can also be easily modified to achieve your own goal.
- Note that the file ERROR_STATE.h is used to return the state of the function if it is executed without any problems or not by returning the state of the function if it is RER_OK , RET_NOK or RET_NULL_PTR and you should take advantage of this feature to verify that your function is executing properly