SV
StudyVirus
Get our free app!Download Free

Data Structures — Set 4

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

00
0/10
1

Which 'GEMS' data structure is the most basic and stores elements of the same data type?

💡

Correct Answer: B. Array

An Array is a collection of similar data items stored at contiguous memory locations. It is the simplest data structure where each data element can be accessed directly by its index number. Arrays are used as building blocks for more complex structures like Stacks and Queues.

2

The 'GEMS' concept of 'Push' and 'Pop' operations is associated with which structure?

💡

Correct Answer: C. Stack

Push adds an item to the top of the stack, while Pop removes the most recently added item. These operations follow the Last-In-First-Out (LIFO) methodology. It is an essential concept for understanding memory management and expression parsing.

3

In 'GEMS' textbooks, which structure is described as a collection of nodes where each node points to the next?

💡

Correct Answer: B. Linked List

A Linked List is a linear data structure where elements are not stored in adjacent memory. Instead, each element is a separate object containing data and a reference to the next object. This allows for efficient insertion and deletion of elements at any position.

4

Which 'GEMS' data structure is used by a printer to manage multiple print jobs?

💡

Correct Answer: C. Queue

Printers use a Queue to ensure that the first document sent is the first one printed. This follows the First-In-First-Out (FIFO) principle of data processing. It prevents data conflict when multiple users send tasks to a single device.

5

What is the 'GEMS' term for the top-most node in a tree data structure?

💡

Correct Answer: C. Root

The Root is the ancestor of all other nodes in a tree and has no parent. Every valid tree must have exactly one root node from which the hierarchy originates. From the root, data branches out to various child nodes and eventually leaf nodes.

6

Which 'GEMS' structure is most useful for finding the shortest path between two cities on a map?

💡

Correct Answer: B. Graph

A Graph consists of nodes representing cities and edges representing the roads connecting them. Algorithms like Dijkstra's are applied to graphs to calculate the most efficient route. Graphs are the primary data structure for GPS and mapping software.

7

In 'GEMS' terminology, what do we call a node that has no children in a tree?

💡

Correct Answer: C. Leaf node

Leaf nodes are the terminal nodes of a tree that do not branch out further. They represent the end of a specific path in the hierarchical structure. In a file system, leaf nodes are typically the actual files, while directories are parent nodes.

8

Which 'GEMS' data structure uses a 'Hash Function' to store and retrieve data quickly?

💡

Correct Answer: C. Hash Table

A Hash Table transforms a large key into a smaller integer index to find data in an array instantly. This provides a very efficient way to look up information, such as finding a phone number in a digital directory. It is a fundamental component of modern database indexing.

9

What 'GEMS' error occurs when a user tries to add an element to a full Stack?

💡

Correct Answer: B. Overflow

Overflow happens when the allocated memory for a fixed-size data structure is completely exhausted. This prevents the system from adding more data and may lead to program crashes if not handled. Monitoring stack size is a critical task in low-level systems programming.

10

Which 'GEMS' data structure is used to implement a 'Undo' feature in text editors?

💡

Correct Answer: B. Stack

The Stack stores every action performed by the user in a sequential manner. When the 'Undo' command is triggered, the most recent action is popped from the stack and reversed. This perfectly utilizes the Last-In-First-Out (LIFO) property.