Found a total of 10000 related content
Cousins in Binary Tree II
Article Introduction:2641. Cousins in Binary Tree II
Difficulty: Medium
Topics: Hash Table, Tree, Depth-First Search, Breadth-First Search, Binary Tree
Given the root of a binary tree, replace the value of each node in the tree with the sum of all its cousins' values.
2024-10-24
comment 0
595
Nested Tree vs Flat Tree
Article Introduction:Tree components are very common and practical. Do you notice that not all tree components are nested structures?
background
Our goal is to visualize tree -shaped data structures in the browser.
// A basic tree -shaped data structure
const timedata = {
ID: 0,
name: "root",
children: [[
{{
ID: 1,
name: "node 1",
children: [[
{{
2025-01-24
comment 0
901
Reverse Odd Levels of Binary Tree
Article Introduction:2415. Reverse Odd Levels of Binary Tree
Difficulty: Medium
Topics: Tree, Depth-First Search, Breadth-First Search, Binary Tree
Given the root of a perfect binary tree, reverse the node values at each odd level of the tree.
For example, suppose t
2025-01-01
comment 0
497
. Find Largest Value in Each Tree Row
Article Introduction:515. Find Largest Value in Each Tree Row
Difficulty: Medium
Topics: Tree, Depth-First Search, Breadth-First Search, Binary Tree
Given the root of a binary tree, return an array of the largest value in each row of the tree (0-indexed).
Example 1:
2024-12-29
comment 0
786
Kth Largest Sum in a Binary Tree
Article Introduction:2583. Kth Largest Sum in a Binary Tree
Difficulty: Medium
Topics: Tree, Breadth-First Search, Sorting, Binary Tree
You are given the root of a binary tree and a positive integer k.
The level sum in the tree is the sum of the values of the nodes t
2024-10-23
comment 0
678
How to Effectively Retrieve Descendants in MySQL Tree Structures?
Article Introduction:This article addresses the task of retrieving descendants in a MySQL table that represents a tree structure of locations. It highlights the limitations of traditional recursive SQL queries and suggests more efficient solutions using MySQL's hierarchi
2024-10-24
comment 0
501
Height of Binary Tree After Subtree Removal Queries
Article Introduction:2458. Height of Binary Tree After Subtree Removal Queries
Difficulty: Hard
Topics: Array, Tree, Depth-First Search, Breadth-First Search, Binary Tree
You are given the root of a binary tree with n nodes. Each node is assigned a unique value from 1
2024-11-03
comment 0
436
Tree Shaking in JS
Article Introduction:Understanding Tree Shaking in JavaScript: A Complete Guide
In the world of modern web development, optimizing your application's performance is crucial. One powerful technique to achieve smaller and faster JavaScript bundles is Tree Shaking. If
2025-01-07
comment 0
1037
How to Print Binary Tree Diagrams in Java?
Article Introduction:Printing Binary Tree Diagrams in JavaIntroduction:Visualizing the structure of a binary tree is crucial for facilitating understanding and...
2024-11-16
comment 0
877
Building an LSM-Tree Storage Engine from Scratch
Article Introduction:Preface
This article will guide you through understanding the Log-Structured Merge-Tree (LSM-Tree), including its core concepts and structure. By the end, you'll be able to build your own storage engine based on LSM-Tree from scratch.
2025-01-03
comment 0
733
How to Visualize Binary Tree Diagrams in Java?
Article Introduction:Binary Tree Diagram Visualization in JavaPrinting a binary tree in a graphical format can provide a clear representation of its structure. In...
2024-11-19
comment 0
910