This project is to find common values in 2 binary trees.
Features:
- Queue
- Methods:
- enqueue
- dequeue
- Methods:
- Classes and Super Class (Animal)
Time Complexity
- The traversal of both trees, which is O(N + M) where N and M are the number of nodes in tree_a and tree_b, respectively. The time operations for hashtable lookups and set insertions are constant.
Space Complexity
- Considering the space for the hashtable and the result set, the maximum space complexity would be O(N + K) where K is the number of common elements stored in the result set.
Source: ChatGPT
