Unique Binary Search

Given an integer n, return the number of structurally unique **BST’**s (binary search trees) which has exctly n nodes unique values from 1 to n.

给你一个证书n,求恰由n个节点组成且节点值从1n互不相同的二叉搜索树有多少种?返回满足题意的二叉搜索树的种数。

unique_binary_search.png

Read more

rust基础入门[23] - More About Lifetimes

本章覆盖有:

  • 简单、自由(free)函数和方法需要避免写入生命周期指示器(lifetime specifiers),因为它们是被推断的
  • 为什么包含引用的结构体(structs)、元组-结构体(tuple-structs)、枚举(enums)需要生命周期指示器(lifetime specifiers)
  • 如何为结构体(structs)、元组-结构体(tuple-structs)、枚举(enums)编写生命周期指示器(lifetime specifiers)
  • 为什么包含指向泛型参数的结构体需要生命周期边界(协变、逆协变)
Read more