Rust Day 13: Leetcode — Minimum Depth of Binary Tree

Arjun Sunil Kumar
Rust Go C++
Published in
2 min readMay 2, 2022

Today was an Okish day! I am progressing, as well as managing my studies. I will be focusing my energy on learning TiKV and TiDB soon. TiKV & TiDB seems to have been written with a perfect choice of language. There are many Databases which have taken inspiration from Google Spanner and PingCAP is one amount them. So for now, let's head straight to the problem.

Problem:

Logic:

Code:

Syntax:

  1. match is used when you have to deal with Option.
  2. match( a.left.clone(), a.right.clone() ) is used for pair combinations.
  3. Use clone whenever you are lending control of a variable to a block or a function. You can use .as_ref() as well, I guess.

Reference:

Found it Interesting?

Please show your support by 👏.

--

--

Arjun Sunil Kumar
Rust Go C++

Writes on Database Kernel, Distributed Systems, Cloud Technology, Data Engineering & SDE Paradigm. github.com/arjunsk