Open In App

Top | MCQs on Graph Data Strcuture with Answers | Question 35

Which of the following operations can be efficiently performed using a segment tree?

(A)



Finding the longest increasing subsequence in a given range

(B)



Finding the most frequent element in a given range

(C)

Finding the number of inversions in a given range

(D)

Finding the top K elements in a given range


Answer: (C)
Explanation:

A segment tree can efficiently find the number of inversions in a given range by performing a modified merge sort algorithm.

Quiz of this Question
Please comment below if you find anything wrong in the above post

Article Tags :
Uncategorized