daihan's blog

By daihan, history, 8 years ago, In English

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 .

  • Vote: I like it
  • -4
  • Vote: I do not like it

| Write comment?
»
8 years ago, # |
  Vote: I like it -14 Vote: I do not like it

quick hint in this problem "Report" indexing queries from 1 to specific number that mean if i say to you sort form 1 to 5 then sort from 1 to 10 then sort from 1 to 15 then from 1 to 20 you should do last query because all previous it is sub query of this query this hint will save many time for unnecessary queries , so far anther hint to solve this problem i will tell you it soon