6 Nisan 2018 Cuma

Goruntu Isleme Odev

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
static int sum =0;
struct Node{
    int data;
    struct Node *left, *right;
};
struct Node *addNode(struct Node *root,int data){
    if(root==NULL){
            struct Node *tmp=(struct Node *)malloc(sizeof(struct Node));
    tmp->data=Null;
    tmp->left=Null;
    tmp->right=NULL;
    return tmp;  
       
    }
    if(root->data<data){
        root->right=addNode(root->right,data);
    }
    else{
        root->left=addNode(root->left,data);
    }
    return root;
}
void print(struct Node *root){
    if(root){
        printf("%d",root->data);
        print(root->left);
         print(root->left);
       
    }
}
int minumum(struct Node *root){
    if(root->left==Null){
        return root->data;
    }
    return minumum(root->left);
}
int max(struct Node *root){
    if(root->right==Null){
        return root->data;
    }
    return max(root->right);
}

Hiç yorum yok:

Yorum Gönder