SV
StudyVirus
Get our free app!Download Free

Data Structures — Set 3

Computers · डेटा संरचनाएं · Questions 2130 of 50

00
0/10
1

Which condition occurs when a user tries to remove an element from an empty data structure like a Stack?

💡

Correct Answer: D. Underflow

Underflow is an error state that indicates the data structure contains no items to be deleted. In a stack, checking if it is empty before a pop operation prevents this error. Conversely, attempting to add to a full structure causes an overflow.

2

A 'Spanning Tree' of a graph is a subgraph that includes all vertices and is also a?

💡

Correct Answer: C. Tree

A Spanning Tree connects all nodes of a graph without forming any loops or cycles. Minimum Spanning Trees are used to design efficient networks with the lowest cost, such as power grids. A single graph can have multiple spanning trees.

3

What is the maximum number of children a node can have in a Binary Tree?

💡

Correct Answer: A. 2

In a binary tree structure, each node is restricted to a maximum of two child nodes. These are typically referred to as the left child and the right child. This restriction simplifies many algorithms for searching and sorting data.

4

Which linear data structure stores elements in a fixed-size block of memory?

💡

Correct Answer: D. Array

An Array is a collection of elements identified by index and stored in a single contiguous block of memory. This allows the computer to access any element in constant time regardless of its position. However, its fixed size makes it less flexible than a linked list.

5

What is the term for a situation where two different keys produce the same hash index in a Hash Table?

💡

Correct Answer: A. Collision

Collision occurs because the number of possible keys often exceeds the size of the hash table's array. Techniques like chaining or open addressing are used to resolve these conflicts. A good hash function aims to minimize the frequency of collisions.

6

Which data structure is most efficient for implementing the 'Back' button feature in a web browser?

💡

Correct Answer: C. Stack

The 'Back' button uses a Stack to store the URLs of pages you have visited. As you visit new pages, they are pushed onto the stack. When you click back, the current page is popped, revealing the previously visited site.

7

In a graph, what is a path that starts and ends at the same vertex called?

💡

Correct Answer: D. Cycle

A Cycle is a closed loop within a graph where a vertex is reachable from itself. Graphs without cycles are often called acyclic graphs, such as trees. Detecting cycles is a critical step in many network and routing algorithms.

8

Which specialized tree data structure is commonly used to implement a dictionary for fast word lookups?

💡

Correct Answer: D. Trie

A Trie, also known as a prefix tree, stores strings by sharing common prefixes among nodes. It is extremely fast for auto-complete features and spell checkers. Each path down the tree represents a word or a part of a word.

9

What is the 'degree' of a vertex in an undirected graph?

💡

Correct Answer: D. The number of edges connected to it

The degree of a vertex represents how many direct connections it has to other nodes. In a directed graph, this is split into in-degree and out-degree. A vertex with a degree of zero is called an isolated vertex.

10

Which data structure is usually used to handle interruptions in a computer system?

💡

Correct Answer: B. Priority Queue

A Priority Queue processes events based on their importance rather than just their arrival time. High-priority interrupts are handled by the CPU before lower-priority background tasks. This ensures that critical system operations are never delayed.