Question: Comparison of data structures Download from this link a compressed file that contains three text files. Each file contains random words and they differ in
Comparison of data structures Download from this link a compressed file that contains three text files. Each file contains random words and they differ in terms of size (please check the size of each file before opening it). Develop a program in C that, for each file: compares, for all the words in each file, the insertion time between a single linked list, a sorted linked list (in lexicographical order), a balanced binary tree, and a binary search tree (in lexicographical order); 2 compares the search time of multiple strings (pick random strings from the file) between the single linked list, the sorted linked list, the balanced binary tree, and the binary search tree; The code below is a template that you can use in order to measure the time of a function in C/C++: #include #include // for time) #include // for sleep // main function to find the execution time of a C program int main() { time-t begin = time(NULL); // do some stuff here sleep (3) time_t end = time(NULL); // calculate elapsed time by finding difference (end - begin) printf(\" Time elpased is %d seconds\", (end - begin)); return 0; } Output: Time elapsed is 3 seconds Notes: (1) Do not try to keep the BST balanced. (2) Use the result of stremp for ordering the words in lericographical order. (3) The last file has size of 500MB. This means that you need to have a lot of RAM available. Thus, you may need to close other running applications (e.g., Internet browser).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
