# Tag Archives: Algorithms-Sorting-Quiz

## When to use each Sorting Algorithm

A sorting algorithm is an algorithm that makes arrange in a certain order. The fundamental task is to put the items in the desired order… Read More »

## Sort an array according to the increasing count of distinct Prime Factors

Given an array of integers. The task is to sort the given array on the basis increasing count of distinct prime factors. Examples: Input :… Read More »

## Sort perfect squares in an array at their relative positions

Given an integer array , the task is to sort only the elements which are perfect squares at their relative positions in the array (positions… Read More »

## Maximize the sum of X+Y elements by picking X and Y elements from 1st and 2nd array

Given two arrays of size N, and two numbers X and Y, the task is to maximize the sum by considering the below points: Pick… Read More »

## Sum of K largest elements in BST using O(1) Extra space

Given a BST, the task is to find the sum of all elements greater than or equal to K-th largest element in O(1) space. Examples:… Read More »

## Algorithms | Sorting | Question 23

Given an array where numbers are in range from 1 to n6, which sorting algorithm can be used to sort these number in linear time?… Read More »

## Algorithms | Sorting | Question 23

Which of the following is true about merge sort? (A) Merge Sort works better than quick sort if data is accessed from slow sequential memory.… Read More »

## Algorithms | Sorting | Question 23

The number of elements that can be sorted in time using heap sort is (A) (B) (C) (d) (A) A (B) B (C) C (D)… Read More »

## Algorithms | Sorting | Question 20

Which sorting algorithms is most efficient to sort string consisting of ASCII characters? (A) Quick sort (B) Heap sort (C) Merge sort (D) Counting sort… Read More »

## Algorithms | Sorting | Question 19

Which of the following sorting algorithms has the lowest worst-case complexity? (A) Merge Sort (B) Bubble Sort (C) Quick Sort (D) Selection Sort Answer: (A)… Read More »

## Algorithms | Sorting | Question 18

Consider the Quicksort algorithm. Suppose there is a procedure for finding a pivot element which splits the list into two sub-lists each of which contains… Read More »

## Algorithms | Sorting | Question 17

In quick sort, for sorting n elements, the (n/4)th smallest element is selected as pivot using an O(n) time algorithm. What is the worst case… Read More »

## Algorithms | Sorting | Question 16

A list of n string, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this… Read More »

## Algorithms | Sorting | Question 15

Which sorting algorithm will take least time when all elements of input array are identical? Consider typical implementations of sorting algorithms. (A) Insertion Sort (B)… Read More »

## Algorithms | Sorting | Question 14

In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. Which of the following is… Read More »