/BST-HardDisk

Creating a binary search tree (BST) on hard disk in an efficient manner

Primary LanguageC

BST On Hard Disk

Writing a BST (Binary Search Tree) on the hard disk. Done as part of the course "Fine Techniques" (UE18CS257D) at PES University.

This code is used to store a BST into a file i.e. the hard disk itself, instead of the heap of the program. Offsets are used to get the position of subtrees.

Functions:

Open File:

init_file("<file_name>.dat")

Insert:

insert_key(<key>, <file_pointer>)

Delete:

delete_key(<key>, <file_pointer>)

Display Inorder BST:

display_inorder(<file_pointer>)

Display Preorder BST:

display_preorder(<file_pointer>)

Client code should contain the functions above if you want to test this code. For examples, look at tests

To compile and execute:

gcc implementation.c <client>.c -o <output_file>.out
./<output_file>.out

This will run the client code against the file which will implement the BST in the file. You can use the three client files already provided if you want to.