Category: sorting

Bubble Sort On Linked List

“Bubble Sort On Linked List” is one of the basic problem based on the linked list data structure and sorting algorithm. Here, we are given a linked list and our task is sort the elements of given linked list in ascending order using bubble sort. Example: Linked List Before Sorting:...

Sort an Array of 0s and 1s

“Sort an Array of 0s and 1s” is one of the favorite technical interview problem of array data structure. Here, we are given an array of size ‘n’ and our task is to sort this array.  Array contains only 0s and 1s. Example: INPUT: Arr[5] = {1, 0, 1, 0,...

blank

Check if Array is Sorted or Not

“Check if Array is Sorted or Not” is a basic problem of array data structure. Here, we are given an array of size ‘n’ and our task is to check if array is sorted or not. Example: INPUT: Arr[9] = {11, 22, 33, 44, 55, 66, 77, 88, 99} OUTPUT:...

blank

Sort the Matrix

“Sort the matrix” is a standard interview problem which has been asked in many technical and algorithmic interview. Here, we are given a matrix of size N*N. Our task is to write a program to sort the given matrix such that all the elements of all rows are sorted and...