Hi Guest, Login

Merge Sort Tree for Range Order Statistics tutorials

User Rating: 0 / 5

Merge Sort Tree for Range Order Statistics

Given an array of n numbers, the task is to answer the following queries:

`  kthSmallest(start, end, k) : Find the Kth smallest                                number in the range from array                               index 'start' to 'end'.  `

Examples:

`  Input : arr[] = {3, 2, 5, 1, 8, 9|       Query 1: start = 2, end = 5, k = 2       Query 2: start = 1, end = 6, k = 4  Output : 2           5  Explanation:  [2, 5, 1, 8] represents the range from 2 to   5 and 2 is the 2nd smallest number   in the range[3, 2, 5, 1, 8, 9] represents   the range from 1 to 6 and 5 is the 4th  smallest number in the range  `

Recommended: Please try your approach on {IDE} first, before moving on to the solution.

Related Article

destination source:https://www.geeksforgeeks.org/merge-sort-tree-for-range-order-statistics/

About us

We provide real application for executing that incredible idea our clients have. Joomhome is a leading Web designing solutions organization, servicing customers in US, UK, Canada, Brazil, Italy, Netherlands, Germany, Australia, Russia, Ireland, Israel, Nigeria, Spain and many more