Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

Suffix Array and Burrows-Wheeler Transform

Suffix Array and Burrows-Wheeler Transform

Suffix Array and Burrows-Wheeler Transform

Description

Task: Edit SuffixArray.cpp

In this part of the assignment, we have provided a file called SuffixArray.cpp that contains initial steps towards implementing a Suffix Array. Function headers (with usage details) are included in SuffixArray.h. Your task is to fill in the missing code.

Remember that, in the naive algorithm to construct a Suffix Array from a given string s of length n, you will likely be doing the following tasks:

Create a vector<int> containing the integers 0, 1, …, n|/p>

Sort the vector<int> such that, when you compare two integers i and j, instead of comparing their actual values, you compare the suffixes of s that start at indices i and j, respectively

For example, if s is DOG, if you are comparing the integers 1 and 2, 1 would be greater than 2 because the suffix of s starting at index 1 (OG)  is alphabetically larger than the suffix of s starting at index 2 (G)

Hint: You will want to define a custom comparison function that, when given two integers i and j, compares the suffixes of s starting at indices i and j. Refer to the C++ sort documentation to see an example of the syntax of defining and using a custom comparison function.

Compiling and Running

We have provided a tester program, SuffixArrayTest, that will help you test your code. You can compile your code using the provided Makefile via the make command:

$ make g++ -Wall -pedantic -g -O0 -std=c++11 -o SuffixArrayTest SuffixArrayTest.cpp SuffixArray.cpp 

If you want to clean up your environment by deleting all the compiled executables, you can simply run make clean:

$ make clean rm -f SuffixArrayTest *.o 

When run, SuffixArrayTest will ask the user to input a string, and it will print the Suffix Array of the user-inputted string. You can assume the string will be in the alphabet {A½. Here’s an example of how it should look like when it’s run from the command line:

$ ./SuffixArrayTest Enter a string: DOG  0 2 1

Task: Edit BWT.cpp

  1. In this part of the assignment, we have provided a file called BWT.cpp that contains initial steps towards implementing the Burrows-Wheeler Transform. Function headers (with usage details) are included in BWT.h. Your task is to fill in the missing code.

Hint: The code you wrote to implement the Suffix Array can likely be adapted to implement the BWT in this challenge.

Compiling and Running

We have provided a tester program, BWTTest, that will help you test your code. You can compile your code using the provided Makefile via the make command:

  1. $ make g++ -Wall -pedantic -g -O0 -std=c++11 -o BWTTest BWTTest.cpp BWT.cpp 

If you want to clean up your environment by deleting all the compiled executables, you can simply run make clean:

$ make clean rm -f BWTTest *.o 

When run, BWTTest will ask the user to input a string (including end-of-string symbol, $), and it will print the Burrows-Wheeler Transform of the user-inputted string. You can assume the string will be in the alphabet {A½. Here’s an example of how it should look like when it’s run from the command line:

$ ./BWTTest Enter a string: BANANA$  ANNB$AA 

Unformatted Attachment Preview

#include
#include “BWT.h”
using namespace std;
/**
* Implement bwt() correctly
*/
string bwt(const string & s) {
/* YOUR CODE HERE */
}
#include
#include
#include “SuffixArray.h”
using namespace std;
/**
* Implement suffix_array() correctly
*/
vector suffix_array(const string & s) {
/* YOUR CODE HERE */
}

Purchase answer to see full
attachment

User generated content is uploaded by users for the purposes of learning and should be used following Studypool’s honor code & terms of service.

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20