Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ homework help Blister.h // do not change #ifndef BLISTER_H #define BLISTER_H #include struct Bode { const char base; Bode *next; public: Bode(char B) :

C++ homework help

image text in transcribed

Blister.h // do not change #ifndef BLISTER_H #define BLISTER_H #include  struct Bode { const char base; Bode *next; public: Bode(char B) : base(B), next(nullptr) { } }; class Blister { private: Bode * start; public: Blister(std::string init); ~Blister( ); friend std::ostream & operator 

// TestBlister.cpp // adapt as desired #include  using namespace std; #include "Blister.h" int main( ) { Blister X("ABCDE"); Blister Y("ACDE"); Blister Z("ABODE"); cout  

Lab 4: Linked Lists A base-sequence such as DNA can be thought of a sequence of letters. Create a class Blister that is a linked-list implementation of a structure that stores and compares base-sequences. It should implement the header file Blister.h provided, without alteration. Bases are stored as upper-case characters. It should use a singly-linked linked list without a dummy node, with all operations running in linear time. The operations are: The constructor takes a string and creates a linked list with those characters in order (first char in first node). The destructor should free up new'ed memory. The stream insertion operator should output the sequence. The length member function returns the number of bases in the sequence. The isSubstitution of member function compares two base-sequences and returns true if they have the same length and differ in exactly one base. The islnsertion Of member function compares two base-sequences and returns true if the one it is called on can be obtained by adding exactly one base to the other base-sequence. For example, MADAM is an insertion-of MAAM as well as an insertion-of ADAM. A driver is provided to help with testing. Edit as desired. Do not add a main to Blister.cpp. Submit via handin just the one file Blister.cpp. Lab 4: Linked Lists A base-sequence such as DNA can be thought of a sequence of letters. Create a class Blister that is a linked-list implementation of a structure that stores and compares base-sequences. It should implement the header file Blister.h provided, without alteration. Bases are stored as upper-case characters. It should use a singly-linked linked list without a dummy node, with all operations running in linear time. The operations are: The constructor takes a string and creates a linked list with those characters in order (first char in first node). The destructor should free up new'ed memory. The stream insertion operator should output the sequence. The length member function returns the number of bases in the sequence. The isSubstitution of member function compares two base-sequences and returns true if they have the same length and differ in exactly one base. The islnsertion Of member function compares two base-sequences and returns true if the one it is called on can be obtained by adding exactly one base to the other base-sequence. For example, MADAM is an insertion-of MAAM as well as an insertion-of ADAM. A driver is provided to help with testing. Edit as desired. Do not add a main to Blister.cpp. Submit via handin just the one file Blister.cpp

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_2

Step: 3

blur-text-image_3

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

Upgrading Oracle Databases Oracle Database New Features

Authors: Charles Kim, Gary Gordhamer, Sean Scott

1st Edition

B0BL12WFP6, 979-8359657501

More Books

Students also viewed these Databases questions