Question 32
Question 33
Question 34
Consider a segment tree built on an array of N elements. What is the time complexity of updating a range of elements in the segment tree?
Question 35
Which of the following operations can be efficiently performed using a segment tree?
Question 36
The following code snippet is the function to insert a string in a trie. Find the missing line.
private void insert(String str){
TrieNode node = root;
for (int i = 0; i < length; i++){
int index = key.charAt(i) - 'a';
if (node.children[index] == null)
node.children[index] = new TrieNode();
________________________
}
node.isEndOfWord = true;
}
b)
c)
d)
Question 38
Given a disjoint-set forest with N elements, what is the maximum height of the trees in the forest after M union operations if union by rank and path compression techniques are used?
There are 38 questions to complete.