Skip navigation
๐Ÿš€ Day 58 | DSA | Tree Concepts
0:00

๐Ÿš€ Day 58 | DSA | Tree Concepts

#dsa #tree #datastructures

๐Ÿš€ Day 58 | DSA | Tree Concepts ๐Ÿ‘‡๐Ÿป Read it hereโ€ฆ --- ๐ŸŒณ Tree Data Structure Basics (DSA) ๐Ÿ‘‘ Root ๐Ÿ”น The topmost node of the tree ๐Ÿ”น Every tree has exactly one root ๐Ÿ”น Starting point of traversal --- ๐Ÿ‘ถ Children ๐Ÿ”น Nodes directly connected below a parent ๐Ÿ”น A parent can have multiple children ๐Ÿ”น Children have exactly one parent --- ๐Ÿ“ฆ Internal Nodes ๐Ÿ”น Nodes that have at least one child ๐Ÿ”น Not leaf nodes ๐Ÿ”น Help in forming tree structure --- ๐Ÿ“Š Level ๐Ÿ”น Position of a node in the tree ๐Ÿ”น Root is level 0 ๐Ÿ”น Level increases as we go down --- ๐Ÿ” Traversals ๐Ÿ”ธ Inorder (L โ†’ Root โ†’ R) --- ๐Ÿ”ธ Preorder (Root โ†’ L โ†’ R) --- ๐Ÿ”ธ Postorder (L โ†’ R โ†’ Root) --- ๐Ÿ“ Height of Tree ๐Ÿ”น Number of edges on the longest path from root to leaf ๐Ÿ”น Empty tree height = -1 (by convention) ๐Ÿ”น Single node tree height = 0 --- ๐Ÿ’ก Interview Tip: ๐Ÿ‘‰ Height โ‰  Number of nodes ๐Ÿ‘‰ Height counts edges, not nodes --- Support โค๏ธ Like โ€ข Save โ€ข Share Follow @codewithbrains for more DSA visuals ๐Ÿš€ #dsa #tree #datastructures #coding #binarytree softwareengineer developer 100daysofcode

Comments

Comments from the original post on Instagram

No comments yet