Data structures

In DFS, a stack data structure is used, while in BFS, a queue is used, as shown in the following diagram:

Figure 17

Get Hands-On Artificial Intelligence for Search now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.