flatten_binary_tree_to_linked_list

  • 2022-12-14
  • 浏览 (564)

flatten_binary_tree_to_linked_list.cpp 源码

// 二叉树展开为链表

#include "stack"
#include "queue"
using namespace std;

struct TreeNode {
    int val;
    TreeNode *left;
    TreeNode *right;

    TreeNode() {}
    TreeNode(int val) : val(val) {}
    TreeNode(int val, TreeNode *left, TreeNode *right) : val(val), left(left), right(right) {}
};

class Solution {
public:
    void flatten(TreeNode* root) {
    }
};

你可能感兴趣的文章

binary_tree_inorder

binary_tree_level_order

binary_tree_level_order_ii

0  赞