Explore topic-wise MCQs in Data Structures and Algorithms.

This section includes 38 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.

1.

What is the time complexity of Uttkonen's algorithm?

A. O (log n!)
B. O (n!)
C. O (n2)
D. O (n log n)
Answer» E.
2.

Which of the following algorithm of data compression uses a suffix tree?

A. Weiner's algorithm
B. Farach's algorithm
C. Lempel - Ziv - Welch's algorithm
D. Alexander Morse's algorithm
Answer» D. Alexander Morse's algorithm
3.

What is a time complexity for finding the total length of all string on all edges of a tree?

A. Ɵ (n)
B. Ɵ (n!)
C. Ɵ (1)
D. O (n2)
Answer» B. Ɵ (n!)
4.

Which statement is correct of suffix tree with a string of length n?

A. The tree has n leaves.
B. The tree has n roots
C. Height of Tree is n
D. Depth of tree is n
Answer» B. The tree has n roots
5.

What is a time complexity for finding the longest substring that is common in string S1 and S2?

A. O (log n!)
B. Ɵ (n!)
C. O (n2+ n1)
D. Ɵ (n1 + n2)
Answer» E.
6.

Which tree allows fast implementation of a set of string operation?

A. Rope Tree
B. Tango Tree
C. Generalized Suffix Tree
D. Top Tree
Answer» D. Top Tree
7.

Who among the following provided the first suffix tree contribution for all alphabet?

A. Weiner
B. Farach
C. Ukkonen
D. Alexander Morse
Answer» C. Ukkonen
8.

Which tree provides a linear time solution for substring operation?

A. Rope Tree
B. Suffix Tree
C. Tango Tree
D. Top Tree
Answer» E.
9.

Can suffix tree be used in string problems occurring in a text editor.

A. True
B. False
Answer» B. False
10.

What is a time complexity for finding the longest palindromic substring in a string by using the generalized suffix tree?

A. Linear Time
B. Exponential Time
C. Logarithmic Time
D. Cubic Time
Answer» B. Exponential Time
11.

What is a time complexity for finding all the tandem repeats?

A. Ɵ (n)
B. Ɵ (n!)
C. Ɵ (1)
D. O (n log n + z)
Answer» B. Ɵ (n!)
12.

What is a time complexity for finding the longest substring that is repeated in a string?

A. O (log n!)
B. Ɵ (n!)
C. O (n2+ n1)
D. Ɵ (n)
Answer» E.
13.

Which of the following data clustering algorithm uses suffix tree in search engines?

A. Weiner's algorithm
B. Farach's algorithm
C. Lempel - Ziv - Welch's algorithm
D. Suffix Tree Clustering
Answer» E.
14.

What is a time complexity for x pattern occurrence of length n?

A. O (log n!)
B. Ɵ (n!)
C. O (n2)
D. Ɵ (n + x)
Answer» E.
15.

Can the two edges that are coming out of a node have labels of string beginning with the same character?

A. True
B. False
Answer» C.
16.

What is a time complexity for finding all the maximal palindrome in a string?

A. Ɵ (n)
B. Ɵ (n!)
C. Ɵ (1)
D. O (log n!)
Answer» B. Ɵ (n!)
17.

Who among the following algorithm is used in external memory and compression of the suffix tree?

A. Weiner's algorithm
B. Farach's algorithm
C. Ukkonen's algorithm
D. Alexander Morse
Answer» C. Ukkonen's algorithm
18.

What is a time complexity for finding frequently occurring of a substring of minimum length in a string?

A. Ɵ (n)
B. Ɵ (n!)
C. O (n2+ n1)
D. O (log n!)
Answer» B. Ɵ (n!)
19.

For what size of nodes, the worst case of usage of space in suffix tree seen?

A. n Nodes
B. 2n Nodes
C. 2n nodes
D. n! nodes
Answer» D. n! nodes
20.

Do all the nodes have at least two children in suffix tree.

A. True
B. False
Answer» C.
21.

What is a time complexity for inserting an alphabet in the tree using hash maps?

A. O (log n!)
B. O (n!)
C. O (n2)
D. O (1)
Answer» E.
22.

What is a time complexity for checking a string of length n is substring or not?

A. O (log n!)
B. O (n!)
C. O (n2)
D. O (n)
Answer» E.
23.

Which of the following is true about the trie?

A. root is letter a
B. path from root to the leat yields the string
C. children of nodes are randomly ordered
D. each node stores the associated keys
Answer» C. children of nodes are randomly ordered
24.

How much time does construction of suffix tree take?

A. O (log M)
B. O (M!)
C. Exponential to Length of Tree
D. Linear to Length of Tree
Answer» E.
25.

What is the other name for Suffix Tree?

A. Array
B. Stack
C. Priority Queue
D. PAT Tree
Answer» D. PAT Tree
26.

Can suffix tree be used in bioinformatics problems and solutions.

A. True
B. False
Answer» B. False
27.

Trie is also known as _________

A. Digital Tree
B. Treap
C. Binomial Tree
D. 2-3 Tree
Answer» B. Treap
28.

How much space does construction of suffix tree takes?

A. O (log M)
B. Exponential to Length of Tree
C. O (M!)
D. Linear to Length of Tree
Answer» E.
29.

Which of the following is the efficient data structure for searching words in dictionaries?

A. BST
B. Linked List
C. Balancded BST
D. Trie
Answer» E.
30.

What can be the maximum depth of the trie with n strings and m as the maximum sting the length?

A. log2n
B. log2m
C. n
D. m
Answer» E.
31.

A program to search a contact from phone directory can be implemented efficiently using ______

A. a BST
B. a trie
C. a balanced BST
D. a binary tree
Answer» C. a balanced BST
32.

Who proposed the concept of Suffix Tree?

A. Weiner
B. Samuel F. B. Morse
C. Friedrich Clemens Gerke
D. Alexander Morse
Answer» B. Samuel F. B. Morse
33.

Auto complete and spell checkers can be implemented efficiently using the trie.

A. True
B. False
Answer» B. False
34.

Which of the following special type of trie is used for fast searching of the full texts?

A. Ctrie
B. Hash tree
C. Suffix tree
D. T tree
Answer» D. T tree
35.

What traversal over trie gives the lexicographical sorting of the set of the strings?

A. postorder
B. preorders
C. inorder
D. level order
Answer» D. level order
36.

What is a time complexity for finding the longest prefix that is common between suffix in a string?

A. Ɵ (n)
B. Ɵ (n!)
C. Ɵ (1)
D. O (log n!)
Answer» D. O (log n!)
37.

Who among the following provided the first online contribution of Suffix Tree?

A. Weiner
B. Samuel F. B. Morse
C. Ukkonen
D. Alexander Morse
Answer» B. Samuel F. B. Morse
38.

Which tree allows fast implementation of string operation?

A. Rope Tree
B. Suffix Tree
C. Tango Tree
D. Top Tree
Answer» C. Tango Tree