+1 714-215-3097

(Solved) : Use Avltreeh Code Written Fand Modify Order Implement Double Rotations Directly Instead Ca Q35601596

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

For example you can write on terminal

./test_tree_mod rebase210.txt sequences.txt

// <Your name>
// Main file for Part2(c) of Homework 2.

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

#include <iostream>
#include <string>
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 tobe
// empty.
template <typename TreeType>
void TestTree(const string &db_filename, const string&seq_filename, TreeType &a_tree) {
// Code for running Part2(b)

} // namespace

main(int argc, char **argv) {
if (argc != 3) {
cout << “Usage: ” << argv[0] << “<databasefilename> <queryfilename>” <<endl;
return 0;
const string db_filename(argv[1]);
const string seq_filename(argv[2]);
cout << “Input file is ” << db_filename << “, andsequences file is ” << seq_filename << endl;
// Note that you will replace AvlTree<int> withAvlTree<SequenceMap>
AvlTree<int> 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-rotationwithout using single rotation . )

Leave a Reply

Your email address will not be published. Required fields are marked *