Data structure in C
Basic concepts of data structure
Algorithm is a finite set of instructions to accomplish a particular task.
Datatypes in C are basic type(char, int, float, double), composite type(array, structure), user-defined type, and pointer type.

I’m going to talk about non-primitive data structure this time.
It is separated to linear data type and non-linear data type. There are array, linked list, stack, queue in linear data type and tree, graph in non-linear data type.
Array and struct
Collection data type

An array is a set of pairs, <index, value>, such that each index that is defined has a value associated with it. A consecutive set of memory locations in C. Therefore logical order is the same as physical order!
Consider the implementation of one-dimensional arrays
int list[5]
It means that we allocates 5 consecutive memory locations and base address which is an address of the first element is ‘list’.
list = &list[0]
C interprets &list[0] as a pointer to an integer of its value. Make a pointer variable and mapping those.
int *list

Struct is structure or record and also is the mechanism of grouping data. It permits the data to vary in type.
‘typedef’ statement creates our own structure data type. It’s kind of user-defined type.

Stacks and queues
Special case of data type, ordered list


In this case, push and pop functions use pointers as parameters. Why? because functions directly fix top-value through pointer, *ptop.

Two variables are used in array-queue, front and rear.