## Pairs such that one is a power multiple of other

You are given an array A[] of n-elements and a positive integer k. Now you have find the number of pairs Ai, Aj such that… Read More »

Quick Links for Sorting

Sorting Terminology |

Stability in sorting algorithms |

Time Complexities of all Sorting Algorithms |

External Sorting |

You are given an array A[] of n-elements and a positive integer k. Now you have find the number of pairs Ai, Aj such that… Read More »

Loop Invariant Condition: Loop invariant condition is a condition about the relationship between the variables of our program which is definitely true immediately before and… Read More »

Given an array of positive integers. Sort the given array in decreasing order of number of factors of each element, i.e., element having the highest… Read More »

We are given an array. We need to sort the even positioned elements in the ascending order and the odd positioned elements in the descending… Read More »

Write a program for sorting variables of any datatype without the use of std::sort . Examples: Input : 2000, 456, -10, 0 Output : -10… Read More »

Given a n x n matrix. The problem is to sort the matrix row-wise and column wise. Examples: Input : mat[][] = { {4, 1,… Read More »

Given a n x n matrix. The problem is to sort the given matrix in strict order. Here strict order means that matrix is sorted… Read More »

Given an array of unsorted positive integer, sort the given array using the Socket programming . Examples: Input : 4 5 6 1 8 2… Read More »

Given an array of an integer of size N. Array contains N ropes of length Ropes[i]. You have to perform a cut operation on ropes… Read More »

Given an array of n integers, we have to reverse sort the array elements such the equal keys are stable after sorting. Examples: Input :… Read More »

Given a string, find concatenation of all substrings in lexicographic order. Examples: Input : s = “abc” Output : aababcbbcc The substrings of s in… Read More »

Given a 2D array, sort each row of this array and print the result. Examples: Input : 77 11 22 3 11 89 1 12… Read More »

Given an array of size N. Find the number of pairs (i, j) such that XOR = 0, and 1 <= i < j <=… Read More »

Given an n sized unsorted array, find median and mode using counting sort technique. Thia can be useful when array elements are in limited range.… Read More »

Given an array arr[] and an integer k, we need to print k maximum elements of given array. The elements should printed in the order… Read More »