Category Archives: Data Structure Tutorial

Data Structure Tutorial

Counting Sort Algorithm

Counting Sort Program In C

Output:-

counting_sort_program_in_c

Heap Sort Algorithm

Heap Sort Program In C

Output:-

heap_sort_program_in_c

Merge Sort Algorithm

Merge Sort Program In C

Output:-

merge sort algorithm

Quick Sort Algorithm

Quick Sort Program In C

Output:-

quick_sort_program_in_c

Selection Sort Algorithm

Selection sort algorithm is a simple sorting algorithm which sort a given set of n number of unsorted elements. In selection sort, smallest element from an unsorted list is selected in every pass and placed at the beginning of the unsorted list.

Working of Selection Sort

The selection sort algorithm first find the smallest element in the array and swap it with the element at first position. Then, find the second smallest element in the array and swap it with the element at second position. This process is repeated until we get the sorted array.

Selection Sort Program In C

In the following C program we have implemented the Selection Sort Algorithm.

Output:-

Selection Sort Algorithm

Insertion Sort Algorithm

Insertion Sort Program In C

Output:-

insertion_sort_program_in_c

 

sdf

Bubble Sort Algorithm

In this tutorial, we will learn about the bubble sort algorithm and its implementation in C, C++, Java and Python.

Bubble Sort Algorithm is a simple sorting algorithm which sort a given set of n number of elements. In Bubble sort, each of the element is compared with its adjacent element and swapped if they are not in the intended order. It compares all elements one by one starting from the first element to sort them in the intended order.

Bubble Sort Program in C

In the following program we are implementing bubble sort algorithm in C language. In this program user will be asked to enter the number of elements and corresponding element values. Later in the program we would sort them in ascending order using this algorithm.

Output:-

Bubble Sort Algorithm