Huffman Coding2

 avatar
user_3763047219
c_cpp
2 years ago
495 B
1
Indexable
Never
/*
 * C Program to Implement Binary Tree using Linked List
 */
#include <stdio.h>
#include <malloc.h>

struct node {
    int value;
    struct node* left;
    struct node* right;
};

int main() {
    int f[3] = {};
    for (int i = 0; i < 3; i++) {
        scanf("%d", &f[i]);
    }
    node * tree,*left,*right;

    tree = (node*)malloc(sizeof(node));
    tree -> value=f[1]+f[2];

    if (f[1] < f[2]) {
        tree->left = f[1];
        tree->right = f[2];
    }
}