Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this project, you are required to write a program to compare the performance of AVL and Splay trees based on the two criteria: the

image text in transcribed

In this project, you are required to write a program to compare the performance of AVL and Splay trees based on the two criteria: the total number of comparisons and the number of rotations. You will be given a text file as input, and your program will read the characters in the text and insert the non-existing ones as keys in the corresponding tree (AVL or Splay) or otherwise (i.e., if existent) find them and update their occurrence frequency in the text. For the AVL tree, if there is an AVL condition violation after inserting the new node, you will employ the proper rotation and make the tree AVL. For the splay tree, you will make the necessary splay(s) after reading each character in the text. The number of comparisons will be considered for both the successful and the unsuccessful searches (i.e., insertions). The number of rotations in AVL trees will be considered only when there is a need for rotation. A single rotation in AVL trees costs one time unit ( tu ) (which is equal to the cost of the comparison of two keys), while a double rotation costs two tu s. A splay in splay trees costs as many tu as the number of depth levels the nodes have moved through. In Splay trees, on the other hand, there will be rotation(s) after reading each character from the text (remember Splay trees!). The output of your program will be: the total cost ( = the cost component from the comparisons + the cost component from the rotations) of the construction and search within both trees. In this project you are expected to develop an algorithm that is capable of finding a solution to the above problem and implement this algorithm in ANSI C that runs under UNIX. You are responsible for demonstrating your program to your TA Mehmet Kaya on the scheduled day that will be announced later. By the due date you are to electronically submit (to canvas) the source code of your program (file name: YourStudentID_Prj2.c) Note that projects submitted after the project's due date will be deducted 5 points each day they are late (until 5 days). After 5davs following the due date, no project will be accepted and evaluated. Please keep this in mind and promptly start working on vour projects! You are required to exhibit an individual effort on this project. Any potential violation of this rule will

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions