problemscpp
A collection of my answers to algorithm problems in c++.
载入中...
搜索中...
未找到
leetcode::construct_string_from_binary_tree::Solution类 参考

#include <leetcode.h>

静态 Public 成员函数

static string tree2str (TreeNode *root)
 

详细描述

在文件 leetcode.h1801 行定义.

成员函数说明

◆ tree2str()

string leetcode::construct_string_from_binary_tree::Solution::tree2str ( TreeNode * root)
static

在文件 leetcode.cpp4685 行定义.

4685 {
4686 ostringstream oss;
4687 oss << root->val;
4688 if(root->left != nullptr) {
4689 oss << '(' << tree2str(root->left) << ')';
4690 } else if(root->right != nullptr) {
4691 oss << "()";
4692 }
4693 if(root->right != nullptr) {
4694 oss << '(' << tree2str(root->right) << ')';
4695 }
4696 return oss.str();
4697 }

引用了 tree2str().

被这些函数引用 tree2str().


该类的文档由以下文件生成: