Solved

# Strange problem with b-trees, and C functions in general

Posted on 1997-05-31

Subject: Strange problem with b-trees, and C functions in general

Hi to everyone...

I need your answer to a strange subject

that has to do with b-trees.

I want to built a function that will create a b-tree and will return its root node.

As parameters to the function I must pass the degree of the tree, the type of key and the key size.

For example:

CreateTree(root,degree,attrType,attrLength)

This function creats a tree of 'degree' and returns its root.

attrType here gives the type of he key

('i' for int,'f' for float and 'c' for string)

attLength gives the size of the key

(4 for int,4 for float and 1-255 for the string)

struct item{

'attrType' key;

struct node *p;

};

struct node{

struct node *p0;

struct item matrix[2*('degree')];

};

Where ' ' indicate a parameter to function

CreateTree(root,degree,attrType,attrLength)

Please help me... How can I do this????

I think this problem is impossible....

ps. (I think unions can't be used since I must pass the key length...)

Thanks for your help...(if any)