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
-
A pointer points to the next record in order.
-
Indexes are required to represent stored records.
-
A tree structure is used to represent multi level index.
-
If the order is lost, the file has to be re-organised.
-
Only 1 and 4.
E
Correct answer
Explanation
Both are the properties of sequential access.
-
AVL tree
-
Min-max heap
-
Binary search tree
-
Unrooted binary tree
-
Random binary tree
C
Correct answer
Explanation
A binary search tree (BST), sometimes also called an ordered or sorted binary tree, is a node-based binary tree data structure.The major advantage of binary search trees over other data structures is that the related sorting algorithms and search algorithms such as inorder traversal can be very efficient.
-
Dynamic memory allocation
-
Stack memory allocation
-
Static memory allocation
-
Memory leak
-
Memory protection
A
Correct answer
Explanation
It corresponds to memory allocated via malloc() or operator new[].
-
Semantic errors
-
Syntactic errors
-
Algorithmic errors
-
Transcription errors
B
Correct answer
Explanation
The Minimum Hamming Distance Method is an error detection and correction technique used in digital communication and coding theory. It is specifically designed to detect and correct bit-level errors that occur during data transmission, which are classified as syntactic errors rather than semantic or algorithmic mistakes.
-
Loop ramming
-
Loop unrolling
-
Both (1) and (2)
-
Either (1) or (2)
B
Correct answer
Explanation
Loop unrolling replicates the loop body multiple times within a single iteration, thereby reducing the number of loop control instructions executed. By processing multiple elements per iteration, the branch prediction overhead and loop condition testing are minimized, significantly improving performance for computationally intensive loops.
-
PQSTRUV
-
PQSTRVU
-
TQSPRUV
-
TSQPRUV
-
None of the above
A
Correct answer
Explanation
The given in-order traversal of tree SQTPURV has root node P (the middle element of tree) and left of P is left subtree and right of P is right subtree, so in pre-order traversal, the root node comes first followed by left and right subtree like PQSTRUV.
-
Previous pointer field
-
Next pointer field
-
Information field of the node
-
Tail
-
Head
E
Correct answer
Explanation
Head contains the address of the first element of the list.
-
A binary search tree is represented by the linked list using pointers.
-
In linked list representation of binary tree, the left pointer points to the data field of the next node.
-
A binary search tree should have data field in the linked list representation.
-
Doubly linked list can be used to represent the binary search tree.
-
None of the above
E
Correct answer
Explanation
All of the above are the true statements.
-
A binary search tree may be empty.
-
In a binary search tree, the left and right subtree of the root are also binary search trees.
-
A binary search tree can be represented using linked list.
-
A binary search tree can be represented using a array.
-
None of the above
E
Correct answer
Explanation
All of the above are the true statements.
-
Zero
-
Null
-
Void
-
It does not return any value if the preceding element is absent
-
None of the above
B
Correct answer
Explanation
It returns Null value if there is no preceding element.
-
It means that the node, which is the smallest of all its children, is called min heap.
-
It means that the node, which is the largest of all its children, is called max heap.
-
It means that the heap is a completely or nearly complete binary tree.
-
Both (2) and (3)
-
None of the above
C
Correct answer
Explanation
This is called Shape property of a heap.
-
Stack
-
Tree
-
Queue
-
Graph
-
Both (2) and (4)
E
Correct answer
Explanation
Yes, both have hierarchical representation of data.
-
A data structure is a logical representation of a particular data.
-
Stack and queue are linear data structures.
-
A heap is called a binary tree.
-
Data structures also have merging operation.
-
None of the above
E
Correct answer
Explanation
Yes, all of the above are the true statements.
-
Fixed length representation
-
Pointer to symbol table entry
-
Trees
-
Buckets
-
Hash tables
A
Correct answer
Explanation
This representation is used when there is an upper bound or limit on the length of the name.
-
sequencing
-
arrangement of objects
-
iteration
-
both (1) and (3)
D
Correct answer
Explanation
Structured programming is built on three fundamental control structures: sequence (executing steps in order), selection (making decisions with if-then-else), and iteration (looping with while or for). These structures form the basis for writing organized, maintainable code without goto statements.