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
-
Red–black tree
-
AVL tree
-
Splay tree
-
T-tree
-
B-Tree
C
Correct answer
Explanation
A splay tree is a self-adjusting binary search tree with the additional property that recently accessed elements are quick to access again. It performs basic operations such as insertion, look-up and removal in O(log n) amortized time. For many sequences of non-random operations, splay trees perform better than other search trees, even when the specific pattern of the sequence is unknown.
-
Force.com
-
LucidDB
-
MapReduce
-
Apache hadoop
-
Wuala
C
Correct answer
Explanation
This framework is a patented software framework introduced by Google to support distributed computing on large sets of data.
-
Use case
-
Performance engineering
-
Algorithmic efficiency
-
Profiling
-
Performance testing
D
Correct answer
Explanation
Profiling is a form of dynamic program analysis that measures, for example, the space or time complexity of a program, the usage of particular instructions, or frequency and duration of function calls. The most common use of profiling information is to aid program optimization.
-
static
-
dynamic
-
linear
-
non-linear
B
Correct answer
Explanation
In a dynamic data structure, it is mandatory to use a concept of pointer. There is no alternative way to pointers for implementing the dynamic data structure.
-
p=&Num;
-
p=Num;
-
p=Num[0];
-
p=Num[50];
B
Correct answer
Explanation
The statement p=Num; is the correct way to store the address in a pointer variable p. Here there is no requirement of address operator(&) before the array name.
-
B-tree
-
Hash table
-
Dequeue
-
Set
-
Bitmap
B
Correct answer
Explanation
Compiler implementations usually use hash tables to look up identifiers. A hash table (also hash map) is a data structure used to implement an associative array, a structure that can map keys to values. A hash table uses a hash function to compute an index into an array of buckets or slots, from which the correct value can be found.
-
Circular buffer
-
Bitmap
-
Graph
-
Tagged union
-
Container
C
Correct answer
Explanation
Graphs and trees are linked abstract data structures composed of nodes. Each node contains a value and also one or more pointers to other nodes. Graphs can be used to represent networks, while trees are generally used for sorting and searching, having their nodes arranged in some relative order based on their values.
-
Union
-
Map
-
Set
-
Container
-
Priority queue
A
Correct answer
Explanation
A union is a value that may have any of several representations or formats, or it is a data structure that consists of a variable which may hold such a value.
-
Tree
-
Stack
-
Queue
-
String
-
Set
C
Correct answer
Explanation
A queue is a First In First Out (FIFO) data structure. In a FIFO data structure, the first element added to the queue will be the first one to be removed. This is equivalent to the requirement that once a new element is added, all elements that were added before have to be removed before the new element can be removed.
-
Manipulation of arithmetic expression
-
Symbol table construction
-
Syntax analysis
-
Hierarchical network
-
Recursion
E
Correct answer
Explanation
Recursion uses stack data structure.
-
Linked list
-
B-tree
-
Hash table
-
Heap
-
Queue
C
Correct answer
Explanation
Quadratic Probing is used for collision resolution in hashing.It is a technique in which the interval between probes is increased by adding the successive outputs of a quadratic polynomial to the starting value given by the original hash computation.
-
Simple linked list
-
BST
-
B+ tree
-
Hash table
-
AVL tree
C
Correct answer
Explanation
The primary value of a B+ tree is in storing data for efficient retrieval in a block-oriented storage context — in particular, filesystems. This is primarily because unlike binary search trees, B+ trees have very high fanout (number of pointers to child nodes in a node,typically on the order of 100 or more), which reduces the number of I/O operations required to find an element in the tree.
-
Bucket sort
-
Prim's minimal spanning tree
-
Bubble sort
-
Shell sort
-
Comb sort
B
Correct answer
Explanation
By using heaps as internal traversal data structures, run time will be reduced by polynomial order. Examples of such problems are Prim's minimal spanning tree algorithm and Dijkstra's shortest path problem.
-
Tree
-
Linked list
-
Stack
-
Queue
-
Set
D
Correct answer
Explanation
The Breadth First Search algorithm uses a queue data structure to store intermediate results as it traverses the graph.
-
A tree is a widely used abstract data type (ADT).
-
A tree can be defined recursively.
-
A walk in which the children are traversed before their respective parents are traversed is called a pre-order walk.
-
An external node is any node that does not have child nodes.
-
A tree is a connected acyclic graph.
C
Correct answer
Explanation
A walk in which the children are traversed before their respective parents are traversed is called a post-order walk.