摘要: /* * @lc app=leetcode.cn id=99 lang=cpp * * [99] 恢复二叉搜索树 * * https://leetcode-cn.com/problems/recover-binary-search-tree/description/ * * algorithms * 阅读全文
posted @ 2021-05-17 20:32 鸭子船长 阅读(295) 评论(0) 推荐(0)
摘要: 1、 find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.h" -or -name "*.rss" ")" -print | xargs wc -l 2、过滤空行 find . -name "*.m" -or 阅读全文
posted @ 2021-05-17 19:49 鸭子船长 阅读(194) 评论(0) 推荐(0)
摘要: 递归算法 二叉树的递归算法非常简单,设置好递归出口之后,根据遍历的顺序,对当前节点的左右子递归调用自身即可。其前序、中序、后序遍历的代码如下。 void preorder1(Node *root) //递归前序遍历 { if (root == NULL) return; printf("%d ", 阅读全文
posted @ 2021-05-17 14:57 鸭子船长 阅读(340) 评论(0) 推荐(0)