Bonaventure OgetoforHojaLeaks Coding Tutorialshojaleaks.com·Oct 12, 2024Introduction to Trees in Data Structures | Day #11Trees are fundamental data structures used in computer science to represent hierarchical relationships. They are essential for organizing data in a way that allows efficient access and manipulation. In this article, we’ll explore tree data structures...Discuss·10 likesData Structures and AlgorithmsTree

Jyotiprakash Mishrablog.jyotiprakash.org·Sep 25, 2024Introduction to TreesIn computer science, trees are a fundamental non-linear data structure composed of nodes connected by edges. A tree is a hierarchical model that represents a collection of elements, each of which can have a number of children but only one parent (exc...Discuss·1.1K readsTrees

Chetan Dattachetan77.hashnode.dev·Sep 23, 2024Height of a Binary Tree - Max DepthProblem Given the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. (link) Example 1: Input: root = [3,9,20,null,null,15,7]...DiscussLeetcodeHeight of a Binary Tree

Chetan Dattachetan77.hashnode.dev·Sep 22, 2024Implementing DFS Using a StackHere we illustrates the implementation of DFS iteratively using stacks. For the recursive implementation of DFS refere this article. Preorder Traversal Problem Given the root of a binary tree, return the preorder traversal of its nodes' values. (link...DiscussLeetcodeinorder

Chetan Dattachetan77.hashnode.dev·Sep 21, 2024Binary Trees | Types | BFS | DFSIntroduction Arrays and linked lists are flat structures, whereas a tree is a hierarchical structure. If a tree has only 2 children, then it is called a binary tree. Terminology Root: The head of the tree is called the root node. Leaf node: A n...DiscussLeetcodetraversals

Meetalistudayyy.hashnode.dev·Jun 30, 2024Why These Trees Won't Save Your Life, But Might Save Your Job!If you have already guessed that it's the topic Trees, then congratulations! Apparently, you and I share the same kind of humor! Data Structures and Algorithms (DSA) have a lot to offer, and one of the most important topics is "Trees". If only people...DiscussTrees

Vineeth Chivukulavineethchivukula.hashnode.dev·Jun 25, 2024Understanding Tree Depth-First SearchTree DFS (Depth-First Search) is a traversal technique used in tree data structures that explores each branch as far as possible before backtracking. This technique can be implemented using recursion or an explicit stack data structure. There are thr...DiscussDFS

Vineeth Chivukulavineethchivukula.hashnode.dev·Jun 25, 2024Understanding Tree Breadth-First SearchTree BFS (Breadth-First Search) is a traversal technique used in tree data structures that explores all the nodes at the present depth level before moving on to nodes at the next depth level. This technique is often implemented using a queue data str...DiscussBFS

Abhilietcode.hashnode.dev·Jun 23, 2024Binary Tree Maximum Path Sum (Hard)A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequence at most once. Note that the path does not need to pass through the root. The path sum...DiscussTreesTree

Abhilietcode.hashnode.dev·Jun 23, 2024Kth Smallest Element in a BST (Medium)Given the root of a binary search tree, and an integer k, return the k<sup>th</sup> smallest value (1-indexed) of all the values of the nodes in the tree. Example 1: Input: root = [3,1,4,null,2], k = 1 Output: 1 Example 2: Input: root = [5,3,6,2,4...DiscussTreesTree