Add implementation of array binary tree.

Rewrite the tree serialization and deserialization methods.
Add applications of array and linked list.
This commit is contained in:
krahets
2023-07-19 16:09:27 +08:00
parent c68f18e480
commit 4e13755023
26 changed files with 680 additions and 178 deletions

View File

@@ -23,7 +23,7 @@ static void preOrder(TreeNode *root) {
/* Driver Code */
int main() {
TreeNode *root = vecToTree(vector<int>{1, 7, 3, 4, 5, 6, 7});
TreeNode *root = vectorToTree(vector<int>{1, 7, 3, 4, 5, 6, 7});
cout << "\n初始化二叉树" << endl;
printTree(root);

View File

@@ -28,7 +28,7 @@ static void preOrder(TreeNode *root) {
/* Driver Code */
int main() {
TreeNode *root = vecToTree(vector<int>{1, 7, 3, 4, 5, 6, 7});
TreeNode *root = vectorToTree(vector<int>{1, 7, 3, 4, 5, 6, 7});
cout << "\n初始化二叉树" << endl;
printTree(root);

View File

@@ -29,7 +29,7 @@ static void preOrder(TreeNode *root) {
/* Driver Code */
int main() {
TreeNode *root = vecToTree(vector<int>{1, 7, 3, 4, 5, 6, 7});
TreeNode *root = vectorToTree(vector<int>{1, 7, 3, 4, 5, 6, 7});
cout << "\n初始化二叉树" << endl;
printTree(root);

View File

@@ -56,7 +56,7 @@ void backtrack(vector<TreeNode *> &state, vector<TreeNode *> &choices, vector<ve
/* Driver Code */
int main() {
TreeNode *root = vecToTree(vector<int>{1, 7, 3, 4, 5, 6, 7});
TreeNode *root = vectorToTree(vector<int>{1, 7, 3, 4, 5, 6, 7});
cout << "\n初始化二叉树" << endl;
printTree(root);