Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Latest commit

 

History

History
executable file
·
14 lines (8 loc) · 364 Bytes

File metadata and controls

executable file
·
14 lines (8 loc) · 364 Bytes

题目

Two elements of a binary search tree (BST) are swapped by mistake.

Recover the tree without changing its structure.

Note: A solution using O(n) space is pretty straight forward. Could you devise a constant space solution?

解题思路

见程序注释