-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathRecoverBinarySearchTree.cs
More file actions
executable file
·38 lines (35 loc) · 1.95 KB
/
RecoverBinarySearchTree.cs
File metadata and controls
executable file
·38 lines (35 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Source : https://leetcode.com/problems/recover-binary-search-tree/
// Author : codeyu
// Date : Thursday, March 9, 2017 11:49:48 PM
/**********************************************************************************
*
*
* 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?
*
*
**********************************************************************************/
using System;
using System.Collections.Generic;
using Algorithms.Utils;
namespace Algorithms
{
/**
* Definition for a binary tree node.
* public class TreeNode {
* public int val;
* public TreeNode left;
* public TreeNode right;
* public TreeNode(int x) { val = x; }
* }
*/
public class Solution099 {
public static void RecoverTree(TreeNode root) {
throw new NotImplementedException("TODO");
}
}}