How to solve sorting problem with different segment in an array

Revision en2, by daihan, 2016-06-14 13:18:13

Supppose somenone give me an array up to 10^6 elements . Then gave some quiries up to 3000 , quries will like that from I index to J index sort in descending , or Ascending order . If 1 ascending , if 2 descending . After quiry how will look the array ? Print the array .

There has a problem like that -> Report . But i want not from 0 index i want from any I to J index .

How i can solve this problem without using STL sort . In efficient way .

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English daihan 2016-06-14 13:18:13 115
en1 English daihan 2016-06-14 13:17:01 562 Initial revision (published)