This project implements a breadth first function taking in tree as an argument and returning a list of all values in the tree in the order they were encountered using a Queue.
Features:
- Queue
- breadth_first
- Node
Reviewed the example, pseudocode and tests provided, whiteboarded test cases and visualized the output. Added the code then used chatgpt to assist on Big O analysis.
Time Complexity: O(n), where n is the number of nodes in the tree. Each node is visited exactly once, making the time complexity linear in the size of the tree.
Space Complexity: O(w), where w is the maximum width of the tree. This represents the worst-case scenario where the queue stores the maximum number of nodes at any level of the tree.
Source: ChatGPT
