#include #include typedef struct cell cell; typedef cell *list; struct cell { int _item; list _next; }; void Insert_front(list *L, int element) { cell *new_cell = (cell*)malloc(sizeof(cell)); new_cell->_item = element; new_cell->_next = *L; *L = new_cell; } void Insert_tail(list *L, int element) { if (!(*L)) { Insert_front(L, element); return; } Insert_tail(&((*L)->_next), element); } void Insert_at(list *L, int element, int index) { if (index == 1) { Insert_front(&((*L)->_next), element); return; } Insert_at(&((*L)->_next), element, index-1); } int Size(list L) { if (!L) { return 0; } return 1 + Size(L->_next); } void Print_inc(list L) { if (!L) { return; } printf("%d \n", L->_item); Print_inc(L->_next); } void Print_desinc(list L) { if (!L) { return; } Print_desinc(L->_next); printf("%d \n", L->_item); return; } int Get(list *L, int index) { if (!L) { return 0; } if (index == 1) { return (*L)->_item; } return Get(&((*L)->_next),index-1); } void Set(list *L, int index, int element) { if (!L) { return; } if (index == 1) { (*L)->_item = element; return; } return Set(&((*L)->_next),index-1,element); }