Merge Sort | C++ Implementation

Merge sort follows *divide-and-conquer* approach. It divides an array of n elements into two subarrays of n/2 elements each. Then it sort the two subarrays recursively using merge sort. And...

Insertion Sort | C++ Implementation

Insertion sort is an efficient algorithm for sorting a small number of elements. The algorithm selects an element from the unsorted array and put it in the proper position in...

Doubly Linked List | C++ Implementation

A node in a doubly linked list contains a data item and a node pointer to the next node. In a singly linked list we can traverse only in one...

Singly Linked List | C++ Implementation

A node in a singly linked list contains a data item and a node pointer to the next node. In a singly linked list we can traverse only in one...

Quicksort | C++ Implementation

The algorithm selects an element as pivot. The input array is divided into two subarrays. All elements in left subarray are less than pivot and all elements in right subarray...

Heapsort | C++ Implementation

Heapsort is implemented using heap data structure. Heap helps us to represent binary tree without using any pointers. Using heap an array can be viewed as a binary tree and...