In binary trees, the views and types refer to different perspectives and classifications of the tree structure.
                     1
                   /   \
                 2       3
                / \     / \
               4   5   6   7
              / \   \     /
             8   9   10  11
1 2 3 4 5 6 7 8 9 10 118
4
2 9 10
1 5 6 11
3 71 2 4 81 3 7 118 4 2 1 3 7 118 9 10 5 6 11 7| View Type | Time Complexity | Space Complexity | 
|---|---|---|
| Horizontal View | O(n) | O(n) | 
| Vertical View | O(n log n) | O(n) | 
| Left View | O(n) | O(n) | 
| Right View | O(n) | O(n) | 
| Top View | O(n log n) | O(n) | 
| Bottom View | O(n) | O(n) | 
        1
       / \
      2   3
     / \
    4   5
        1
       / \
      2   3
     / \  /
    4   5 6        1
       / \
      2   3
     / \ / \
    4  5 6  7        1
       / \
      2   3
     /     \
    4       5
        4
       / \
      2   5
     / \   \
    1   3   6
         1
        /
       2
      /
     3
    /
   4
OR
   1
    \
     2
      \
       3
        \
         4
| Binary Tree Type | Time Complexity | Space Complexity | 
|---|---|---|
| Full Binary Tree | O(n) | O(n) | 
| Complete Binary Tree | O(n) | O(n) | 
| Perfect Binary Tree | O(log n) | O(log n) | 
| Balanced Binary Tree | O(log n) | O(log n) | 
| Binary Search Tree (BST) | Average Case: O(log n) | O(n) | 
Note: also read about Binary Trees: Structure & Tree travels
If you like my post please follow me to read my latest post on programming and technology.
https://www.instagram.com/coderz.py/
https://www.facebook.com/coderz.py
Staying up to the mark is what defines me. Hi all! I’m Rabecca Fatima a keen learner, great enthusiast, ready to take new challenges as stepping stones towards flying colors.
A design pattern is a reusable solution to a commonly occurring problem in software design. They…
Factory Method is a creational design pattern that deals with the object creation. It separates…
You are given two singly linked lists that intersect at some node. Your task is…
A builder plans to construct N houses in a row, where each house can be…
Find the length of the longest absolute path to a file within the abstracted file…
You manage an e-commerce website and need to keep track of the last N order…