Queue can be generally thought as horizontal in structure i.e, breadth/width can be attributed to it – BFS, whereas
Stack is visualized as a vertical structure and hence has depth – DFS.
Queue can be generally thought as horizontal in structure i.e, breadth/width can be attributed to it – BFS, whereas
Stack is visualized as a vertical structure and hence has depth – DFS.