Redirected
edited by
2,127 views
2 votes
2 votes

edited by

8 Answers

Best answer
4 votes
4 votes

If I swap 15 with the last element, then 12 and 16 remain unchanged !!

Then, total elements which change their positions are 6.


If I swap 15 with the first element, then only 16 remains unchanged !!

Hence, in this case the elements which change their positions are 7.


This question is ambiguous as i think it should give the position. But if not given( like here ), i would go with the maximum .i.e, 7.

As in both the case only 16 is constant by any method, we apply and all others (CAN) change their position means they are having the ability to change their positions . Hence I suppose , 7 should be correct .

selected by
3 votes
3 votes

7 ans

2 votes
2 votes

Answer will be (7).

0 votes
0 votes
simply make one move in the beginning to swap the 15 to position from where u are comfortable to apply quick sort algorithm either at middle, first position or last.
Answer:

Related questions

1 votes
1 votes
1 answer
1
Rohan Mundhey asked Nov 9, 2016
621 views
Consider the following sequence of letters (Assume always select last element as pivot and array index starts with 0)Q, U, I, C, K, S, O, R, T, E, X, A, M, P, L, EWhat is...
0 votes
0 votes
3 answers
4
ajaysoni1924 asked Sep 2, 2019
3,469 views
In quick sort for sorting of n Numbers, the 75th greatest Element is selected as pivot using $O(n^2)$ time complexity algorithm than what is the worst case time complexit...