Rust Day 16: Leetcode — Binary Tree Pre Order
Published in
May 6, 2022
Completing the streak today as well. Trees are an important topic in Computer Science. They are a nice structure for organizing things. I have seen variants of trees, like BTree, KD Tree, etc used to solve problems in the Databases and Processing domain. If we doing a point lookup or a range lookup, a data structure like a tree gives an easy way to ignore almost half of the unwanted items, at every level.
Problem:
Logic:
Code:
Syntax:
- local function:
2. &mut
helps you mutate the vector passed.
Reference:
Found it Interesting?
Please show your support by 👏