data structures

Advantages of singly linked list

the main advantages of singly linked list are: 1) Singly linked list can store data in non-contiguous locations. Thus there is no need of compaction of memory, when some large related data is to be stored into the memory. 2) Insertion and deletion of …

C program to create a linear linked list

The program shown below first allocates a block of memory dynamically for the first node using the statement head = (node *)malloc(sizeof(node)); which returns a pointer to a structure of type node that has been type defined earlier. The lin…

Bubble sorting

Bubble sort , sometimes incorrectly referred to as sinking sort , is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order.…

stack

In computer science , a stack is a last in, first out ( LIFO ) abstract data type and linear data structure . A stack can have any abstract data type as an element , but is characterized by two fundamental operations, called push and pop (or pull). …

Load More
That is All