Which of the following is an application of Red-black trees and why?

Category: QuestionsWhich of the following is an application of Red-black trees and why?
Editor">Editor Staff asked 4 weeks ago

Which of the following is an application of Red-black trees and why?
 
(a) used to store strings efficiently
 
(b) used to store integers efficiently
 
(c) can be used in process schedulers, maps, sets
 
(d) for efficient sorting
 
I’d like to ask this question from Red Black Tree topic in section Binary Trees of Data Structures & Algorithms I
 
This question was addressed to me in an online interview.

1 Answers
Editor">Editor Staff answered 4 weeks ago

The correct option is (c) can be used in process schedulers, maps, sets
 
Easiest explanation – RB tree is used for Linux kernel in the form of completely fair scheduler process scheduling algorithm. It is used for faster insertions, retrievals.