Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You will use avl_tree.h code you have written fand you will modify it in order to implement double rotations directly instead of calling the two

You will use avl_tree.h code you have written fand you will modify it in order to implement double rotations directly instead of calling the two single rotations. Name your modified implementation avl_tree_modified.h. Run the exact same routines as in Part2(b), but now with your modified Avl implementation. The executable should be named test_tree_mod. The results should be the same as in Part2(b).

For example you can write on terminal

./test_tree_mod rebase210.txt sequences.txt

test_tree_mod.cc

// // Main file for Part2(c) of Homework 2.

#include "avl_tree_modified.h" // You will have to add #include "sequence_map.h"

#include #include using namespace std;

namespace {

// @db_filename: an input database filename. // @seq_filename: an input sequences filename. // @a_tree: an input tree of the type TreeType. It is assumed to be // empty. template void TestTree(const string &db_filename, const string &seq_filename, TreeType &a_tree) { // Code for running Part2(b) }

} // namespace

int main(int argc, char **argv) { if (argc != 3) { cout << "Usage: " << argv[0] << " " << endl; return 0; } const string db_filename(argv[1]); const string seq_filename(argv[2]); cout << "Input file is " << db_filename << ", and sequences file is " << seq_filename << endl; // Note that you will replace AvlTree with AvlTree AvlTree a_tree; TestTree(db_filename, seq_filename, a_tree);

return 0; }

Thank you very much for your help.

Please help me with test_tree_mod and creating avl_tree_modified (all the routines are created excepted for the double-rotation without using single rotation . )

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

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

1583474013, 978-1583474013

Students also viewed these Databases questions

Question

6. Explain the strengths of a dialectical approach.

Answered: 1 week ago