Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdbool.h>
- typedef struct Node {
- int data;
- struct Node *left, *right;
- } Node;
- struct Node *newNode(int value) {
- Node *node = (Node*)malloc(sizeof(Node));
- node->data = value;
- node->left = node->right = NULL;
- return node;
- }
- unsigned int countNodes(Node *root) {
- if (root == NULL) {
- return 0;
- }
- return 1 + countNodes(root->left) + countNodes(root->right);
- }
- void menu() {
- printf("==================\n");
- printf("= SCAPEGOAT TREE =\n");
- printf("==================\n");
- }
- int main(int argc, char * argv[]){
- menu();
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement