This project was created as a homework from auxiliary courses of programming by Ilya Dedinsky.
Main purpose of this project is working with such structure of data like a List.
List is a such data structure which has next features:
-
Addition in the list has asymptotics o(1) (read about asymptotics here).
-
Delete operation has asymptotics o(1).
-
Finding an element in the list has asymptotics o(N)
-
Clone this repository into your local directory with command:
for SSH:
git clone git@github.com:BileyHarryCopter/List.git
for HTTP:
git clone https://github.com/BileyHarryCopter/List.git
-
Go to the clonned repository with:
cd List
And launch compilation with make:
make
-
After these steps you'll receive file ./start which you need to launch the program:
./start
In this project I use incapsulation of initialization the structure due to hide fields of the list from user.
This procedure is needed for more safe working with the structure. Because of these principles user has following command list:
-
For creation a new list use
ListCtor (<name of a list>)
:List_t *ListCtor (char * list_name);
-
For removal the list use
ListDtor (<list>)
:int ListDtor (List_t *list);
-
For receiving number of element in any order use functions:
3.1. In logical order from physical number:
int PhysToLog (List_t *list, int phys_pos);
3.2. In physical order from logical number:
int LogToPhys (List_t *list, int log_pos);
-
For inserting data in the list use
ListInsrt
:int ListInsrt (List_t *list, int mode, int insrt_ptr, data_t insrt_val);
with following modes:
4.1. Modes NEXT or JUST - insert after transmitted number of position.
4.2. Mode PREV - insert before transmitted number of position.
-
For delete an element from the list use
ListDelete
:int ListDelete (List_t *list, int del_ptr);
-
For creation of text dumping of the list use function
ListPrint
:void ListPrint (List_t list);
-
For creation of graph (to configure the necessary API read more) dumping of the list use function
GraphDump
:int GraphDump (List_t *list);
-
For linearization of the list use function
ListLinearisation
:int ListLinearisation (List_t *list);
For using GraphVis you should set this API on your computer. This link helps you to set dot.
Demonstration of linearisation of the list:
- There is a list without linearization procedure:
- There is a list with linearization procedure:
Also sometime you can see similar messages in the terminal:
And you'll see in the Logfile message about the error: