Question
Counting Sort is an efficient sorting algorithm when the
range of input elements (k) is not significantly larger than the number of elements (n). What is its time complexity?Solution
Counting Sort works by counting the frequency of each distinct element in the input array. It then uses this count information to place elements in their correct sorted positions. The time complexity involves iterating through the input array (O(N)) and iterating through the count array (which depends on the range K), making its overall time complexity O(N + K).
Five persons have different heights, W is taller than R, but shorter than E. R is taller than Q and T. Who is the 2 nd shortest person?
What can be the possible height of F?
Three statements are given, followed by three conclusions numbered I, II and III. Assuming the statements to be true, even if they seem to be at varian...
Statement : "The government has decided to build more highways to improve connectivity."
Assumptions :
I. Highways help in economic grow...
Five friends M, N, O, P and Q have different heights but not necessarily in the same order. M is taller than N. Q is taller than P, who is taller than N...
Six persons S, T, U, V, W and X have different weights in kg. T is heavier than U but lighter than S, who is the second heaviest among all. W is lighter...
In a row of boys facing the north, Amit is fifteenth from the left end and Dev is fifteenth from the right end. Subham, who is fifth to the right of Ami...
Who among the following person/persons are heavier than the fourth shortest persons?
I. R
II. T
III. W
N is the grandmother of _____.
Five persons W, U, Q, M and K have different weights. U is the lightest person. Q is heavier than M but lighter than K. W is lighter than M. Who among t...