BFS (iterative and recursive) in Tree
There are 2 approaches to traversing a binary tree: use Depth-First search (DFS) and Breadth-First search (BFS). In case of […]
There are 2 approaches to traversing a binary tree: use Depth-First search (DFS) and Breadth-First search (BFS). In case of […]
There are 2 approaches to traversing a binary tree: use Depth-First search (DFS) and Breadth-First search (BFS). In case of
To implement a simple binary tree, firstly we have to create a traverse function. Traverse function is used to find
Implementation of the Queue is so similar to a Stack. We operate with the queue using a FIFO-approach: add elements
Stack is also a type of LinkedList, but without the ability to retrieve i-th element. We can only retrieve (pop)
The task of implementing LinkedList can also be encountered during interviews with newcomers. The solution depends on the type of
The task to implement a HashTable is the most popular one in interviews. General points of this algorithm: