摘要: string转int #include <iostream> #include <string> using namespace std; int main() { char* s = "1234"; string str("5678"); int intS = atoi(s); //此写法会报错 阅读全文
posted @ 2025-03-04 20:02 yizhixiaozhu 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 中序遍历即可。只需要记录一个pre指针即可。 高分答案也太绕了吧 class Solution { public: TreeNode* Convert(TreeNode* pRootOfTree) { if(pRootOfTree == nullptr) return nullptr; TreeNo 阅读全文
posted @ 2025-03-04 19:13 yizhixiaozhu 阅读(0) 评论(0) 推荐(0) 编辑
摘要: C++非递归前序遍历 /** * struct TreeNode { * int val; * struct TreeNode *left;\images\20211111\392807_1636599059575\FE67E09E9BA5661A7AB9DF9638FB1FAC * struct 阅读全文
posted @ 2025-03-04 18:16 yizhixiaozhu 阅读(6) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示