Data Structures — Set 2
Computers · डेटा संरचनाएं · Questions 11–20 of 50
A 'Heap' is a specialized tree-based data structure used primarily for implementing which of the following?
Correct Answer: A. Priority Queues
Heaps are used to efficiently find and remove the element with the highest or lowest value. They satisfy the heap property where the parent node is always greater or smaller than its children. This makes them ideal for task scheduling based on priority.
Which type of linked list allows for traversal in both forward and backward directions?
Correct Answer: D. Double Linked List
A Doubly Linked List node contains pointers to both the next node and the previous node. This increased flexibility comes at the cost of extra memory for the second pointer. It is commonly used in browser navigation history where you move back and forth.
In an Array, what is the term used for the position of an element starting from zero?
Correct Answer: C. Index
The Index represents the numerical address of an element within the array structure. Most programming languages use zero-based indexing, meaning the first element is at index 0. This allows the computer to calculate the memory address of any element instantly.
Which data structure is typically used to represent a file system in a modern computer?
Correct Answer: C. Tree
File systems are organized in a hierarchical root-directory-file manner which is perfectly modeled by a Tree. Directories act as parent nodes while files are the leaf nodes. This structure allows for efficient organization and navigation of data on a disk.
What is the time complexity for searching an element in a balanced Binary Search Tree (BST)?
Correct Answer: C. O(log n)
In a balanced BST, the search space is halved at each step, leading to logarithmic time complexity. This makes searching much faster than a linear search through an unsorted array. Popular balanced trees include AVL trees and Red-Black trees.
Which graph representation uses a two-dimensional matrix to show connections between nodes?
Correct Answer: A. Adjacency Matrix
An Adjacency Matrix is a square grid where the rows and columns represent vertices. A value in the matrix indicates whether an edge exists between two corresponding vertices. It is easy to implement but can waste memory if the graph is sparse.
Which data structure is used to implement a 'Breadth First Search' (BFS) algorithm on a graph?
Correct Answer: D. Queue
BFS explores nodes level by level, requiring a Queue to keep track of the nodes to be visited next. It ensures that all neighbors of a node are visited before moving to the next level. This algorithm is often used to find the shortest path in an unweighted graph.
Which of the following describes a 'Full Binary Tree'?
Correct Answer: A. Every node has either 0 or 2 children
A Full Binary Tree is a specific type where no node has only one child. This property is important for certain memory management and data compression algorithms like Huffman coding. It is also sometimes referred to as a strictly binary tree.
The process of rearranging data in a specific order (ascending or descending) is called?
Correct Answer: D. Sorting
Sorting is a fundamental operation in data structures to make searching more efficient. Common sorting algorithms include Bubble Sort, Merge Sort, and Quick Sort. Efficient sorting is crucial for performance in large-scale database systems.
Which data structure allows insertion and deletion from both ends?
Correct Answer: A. De-queue (Double-ended queue)
A De-queue provides the functionality of both a stack and a queue simultaneously. Users can add or remove elements from either the 'front' or the 'rear'. It is used in applications like web browser caches where both recent and old data need management.