© 2023 Hashnode

#treetraversals

Trees are a fundamental data structure in computer science, and their traversal is a common operation in many algorithms. There are several ways to traverse a tree, each with its own advantages and di…

What is a Tree? A tree is a nonlinear data structure. It is a collection of nodes where each node contains addresses of other nodes. A tree data structure has a root node, internal nodes and leaf nodes. The number of children of a node dete…

Another Easy category problem which tests our understanding of tree data structures. With the eight th problem of the December leetcoding challenge https://leetcode.com/problems/leaf-similar-trees/ we…

Overview Modeling hierarchical tree structures in SQL databases has traditionally been difficult. At least until the introduction of Recursive Common Table Expressions (Recursive CTEs) that made it mu…

What is Morris traversal? Morris traversal is used to traverse through binary tree without using stack or recursion. Morris traversal is based on Threaded binary tree. What is Threaded binary Tree Thr…

Question: Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). Example 1: Input: root = [3,9,20,null,null,15,7] Output: [[3],[9,20],[15,7]] Example 2: Input: ro…