Utilize o código fonte em linguagem C seguinte para responder as questões 45 e 46.
#include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node* left;
struct Node* right;
};
struct Node* createNode(int data) {
struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
newNode->data = data;
newNode->left = NULL;
newNode->right = NULL;
return newNode;
}
struct Node* insert(struct Node* root, int data)(
if (root == NULL) {
return createNode(data);
}
if (data < root->data) (
root->left = insert(root->left, data);
Y else if (data > root->data) £
root->right = insert(root->right, data);
}
return root;
}
struct Node* search(struct Node* root, int key) {
if (root == NULL || root->data == key){
return root;
}
if (key < root->data) (
return search(root->left, key);
}
return search(root->right, key);
}
void list(struct Node* root) {
if (root != NULL) {
list(root->left);
printf("%d ”, root->data);
list(root->right);
}
}
int main() {
struct Node* root = NULL;
root = insert(root, 50);
root = insert(root, 20);
root = insert(root, 70);
root = insert(root, 20);
root = insert(root, 50);
list(root);
return 0;
}
Qual é o resultado apresentado pela execução do código?