MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
BFT uses which data structure?
A
stack
B
tree
C
queue
D
hash
Explanation: 

Detailed explanation-1: -The BFT will use a queue as an auxiliary structure to hold nodes for future processing and the DFT will use a STACK. During the execution of these algorithms, each node N of G will be in one of three states, called the status of N, as follows: STATUS = 1 (Ready state): The initial state of the node N.

Detailed explanation-2: -A queue (FIFO-First in First Out) data structure is used by BFS. You mark any node in the graph as root and start traversing the data from it.

Detailed explanation-3: -BFS uses a queue to keep track of the next location to visit. whereas DFS uses a stack to keep track of the next location to visit. BFS traverses according to tree level, while DFS traverses according to tree depth. BFS is implemented using a FIFO list; on the other hand, DFS is implemented using a LIFO list.

Detailed explanation-4: -Traversal means to visit each node of a graph. For graphs, there are two types of traversals: Depth First traversal and Breadth-First traversal.

Detailed explanation-5: -Breadth First Search (BFS) algorithm traverses a graph in a breadthward motion and uses a queue to remember to get the next vertex to start a search, when a dead end occurs in any iteration.

There is 1 question to complete.