What is a time complexity for finding the longest substring that is common in string S1 and S2 (n1 and n2 are the string lengths of strings s1, s2 respectively)?
A. O (log n!)
B. Ɵ (n!)
C. O (n2+ n1)
D. Ɵ (n1 + n2)
Answer: Option D
A. O (log n!)
B. Ɵ (n!)
C. O (n2+ n1)
D. Ɵ (n1 + n2)
Answer: Option D
What is the primary property of an AVL tree?
A. It allows duplicate keys.
B. It is a self-balancing binary search tree.
C. It maintains a fixed height.
D. It allows duplicate keys.
Which of the following operations is used to restore balance in an AVL tree after insertion?
A. Merging
B. Splaying
C. Rotations
D. Hashing
In a Red-Black tree, which property ensures that no two consecutive red nodes exist on any path?
A. Black property
B. Balance property
C. Height property
D. Red property
What is the maximum height of an AVL tree with n nodes?
A. log2(n + 1)
B. log2(n)
C. 2*log2(n)
D. log10(n)
Join The Discussion