Computer Knowledge
Data Structures and Algorithms
1,518 Questions
Data Structures and Algorithms form the core of computer science, focusing on arrays, linked lists, trees, and sorting mechanisms. These concepts are essential for solving complex computational problems efficiently. Test takers preparing for technical and administrative IT exams will find these questions highly relevant.
Array OperationsLinked List ApplicationsSorting AlgorithmsTree Data StructuresMultilevel IndexingAlgorithm Time Complexity
Data Structures and Algorithms Questions
-
K J I N M L
-
K J M N L I
-
M N L K J I
-
N M K L J I
-
N M L K I J
B
Correct answer
Explanation
This is the correct postorder traversal of the binary tree. Here, we first create the tree using preorder and inorder traversal. Then, find out postorder traversal. First select root from the given preorder that is I. Now, select its left subtree nodes and the right subtree nodes from inorder. We continue to apply this process until all nodes are not finished.
-
P Q S T R U
-
P Q R S T U
-
P Q S R U T
-
Q S T P R U
-
P Q S R T U
A
Correct answer
Explanation
This is the correct preorder traversal of the binary tree. Here, we first create the tree using postorder and inorder traversals. Then, find out the preorder traversal. First select root from given postorder that is P, now select its left subtree [LST] nodes and right subtree [RST] nodes from inorder. The LST node of root P is S Q T and RST nodes of P is R U. Now, take S Q T and apply the same process. Here, we get root node Q from postorder [S T Q] and its LST and RST nodes from inoder [S Q T]. Similary, we take R U and apply the same process. Here, we get root node R from postorder [U R] and its LST and RST nodes from inoder [R U].
-
Division method
-
Folding method
-
Midsquare method
-
Multiplicative method
-
Digit analysis
B
Correct answer
Explanation
In folding method, a key is broken into several parts and each part has the same length as that of the required address except the last part.
-
root node
-
leaf node
-
internal node
-
pendent node
-
child node
A
Correct answer
Explanation
Root node is a node without a parent.
-
0 child or leaf node
-
3 child nodes
-
1 child node
-
2 child node
-
m child nodes
D
Correct answer
Explanation
When a node with 2 child nodes is deleted, then it is replaced by its next inorder successor node.
-
full binary tree
-
complete binary tree
-
skewed binary tree
-
binary search tree
-
B-tree
B
Correct answer
Explanation
Complete bianry tree is a type of binary tree in which all levels except possibly the last are full, and the last level has all its nodes to the left side.
-
Counting Sort
-
Radix Sort
-
Merge Sort
-
Decision Tree
-
Algorithm
B
Correct answer
Explanation
It solves the problem of cards sorting counterintuitively by sorting on the least significant digit first.
-
Big-Omega Notation
-
Little-O Notation
-
Space Complexity
-
Time Complexity
-
Effectiveness
A
Correct answer
Explanation
It expresses the lower bound of the running time of an algorithm.
-
Double Hashing
-
Extendible Hashing
-
Probe Sequence
-
Chaining
-
Dynamic Hashing
B
Correct answer
Explanation
It achieves its goal by merging the concepts of a radix search tree and hashing.
-
Counting Sort
-
Bucket Sort
-
Decision Tree
-
Merge Sort
-
Direct Sequence
B
Correct answer
Explanation
It runs linear time when input is drawn from a uniform distribution.
-
Space Complexity
-
Little-O Notation
-
Theta Notation
-
Time Complexity
-
Algorithm
C
Correct answer
Explanation
It represents the upper bound and the lower bound of the running time of an algorithm.
-
Double Hashing
-
Buckets
-
Directory
-
Linear Probing
-
Dynamic Hashing
D
Correct answer
Explanation
Here, we start searching the hash table sequentially from the beginning of the original hash location if a location is occupied, we check the next location.
-
Little-O Notation
-
Little-Omega Notation
-
Time Complexity
-
Space Complexity
-
Effectiveness
B
Correct answer
Explanation
It is the method of expressing the loose lower bound of the running time of an algorithm.
-
Little-O Notation
-
Time Complexity
-
Big-O Notation
-
Program
-
Space Complexity
C
Correct answer
Explanation
It is the function of expressing the upper bound of the running time of an algorithm.
-
Chaining
-
Double Hashing
-
Buckets
-
Quadratic Probing
-
Dynamic Hashing
D
Correct answer
Explanation
Primary clustering problem can be almost eliminated if we use quadratic probing scheme.