Sorting using trivial hash function.
Examples:
Input : 9 4 3 5 8
Output : 3 4 5 8 9
We have read about various sorting algorithms such as heap sort, bubble sort, ...

Share

Given a matrix, sort the rows of matrix in ascending order followed by sorting the columns in descending order.
Examples :
Input : a[3][3] = {{1, 2, 3},
...

Share

Given a 2D array, sort each row of this array and print the result.
Examples:
Input :
77 11 22 3
11 89 1 12
32 11 56 7
11 22 44 33
Output :
3 11 22 77
1 11 12 89
7 11...

Share

Given a queue with random elements, we need to sort it. We are not allowed to use extra space. The operations allowed on queue are :
enqueue() : Adds an item to rea...

Share

Given an array of elements, task is to sort these elements using stack.
Prerequisites : Stacks
Examples :
Input : 8 5 7 1 9 12 10
Output : 1 5 7 8 9 10 12
Explanati...

Share