Computer Knowledge
Data Structures and Algorithms
1,256 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
-
Double
-
Union
-
Function
-
Array
A
Correct answer
Explanation
In C, scalar data types include basic types like int, char, float, and double. Arrays, unions, and functions are derived or aggregate types.
-
Tree
-
List
-
Hash table
-
None of these
C
Correct answer
Explanation
Hash table is good for doing a quick search on symbol tables.
-
Least recently used
-
Optimal
-
FIFO
-
L1 cache
-
L2 cache
B
Correct answer
Explanation
This replacement algorithm is the one in which the page which least likely to be referenced is selected.
A
Correct answer
Explanation
A tree is a non-linear data structure that represents hierarchical relationships between elements, such as a root node with child nodes.
-
sorting
-
deletion
-
searching
-
in serration
C
Correct answer
Explanation
Searching is the process of finding the location of a specific element within a data structure.
-
arrays
-
data type
-
record of file
-
none of these
A
Correct answer
Explanation
An array is a data structure consisting of a collection of elements, each identified by at least one array index or key, all of the same data type.
-
traversal
-
heap
-
sorting
-
merging
D
Correct answer
Explanation
Merging is the process of combining two or more sorted sequences into a single sorted sequence.
D
Correct answer
Explanation
In a singly (linear) linked list, each node contains two parts: the data (information) and the pointer (address) to the next node.
-
the linked field or next pointer field
-
the pervious pointer field
-
the information of the element
-
none of these
A
Correct answer
Explanation
The second part of a node in a singly linked list is the pointer field, which stores the address of the next node in the sequence.
-
Two-dimensional array
-
One- dimenstrional array
-
Multi dimensional array
-
Single ten array
B
Correct answer
Explanation
One-dimensional arrays require only one index to access an element (like arr[5]). Two-dimensional arrays need two indices (arr[3][2]), and multidimensional arrays need even more. The term 'One-dimenstrional' has a typo but is clearly intended.
-
substitution
-
recursion
-
non-recursion
-
none of the above
B
Correct answer
Explanation
Depth-First Search (DFS) is a classic algorithm that traverses tree or graph structures by going as deep as possible before backtracking, which is naturally implemented using recursion.
-
DFS algorithm
-
BFS algorithm
-
Best-First Search algorithm
-
Problem reduction
C
Correct answer
Explanation
A* is a classic informed search algorithm that uses a heuristic function to guide a Best-First Search, balancing the cost from the start and the estimated cost to the goal.
-
DFS algorithm
-
Problem reduction
-
Best-First Search algorithm
-
None of these
B
Correct answer
Explanation
The AO* algorithm is designed to search AND-OR graphs, which are used for problem reduction, where a complex problem is broken down into smaller, simpler subproblems.
A
Correct answer
Explanation
In C, array indexing starts at 0. The 3rd element is at index 2, which is accessed via *(s+2).
-
Linear list
-
Queue
-
Tree
-
Stack
D
Correct answer
Explanation
The Shunting-yard algorithm, which converts infix to postfix, uses a stack to hold operators until they can be placed in the output string.