Huffman Coding2
user_3763047219
c_cpp
3 years ago
495 B
8
Indexable
/*
* 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];
}
}Editor is loading...