Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python Implement a class named SequentialStringList. In this class implement a method called add, that when given a string, it adds it to an

In python Implement a class named SequentialStringList. In this class implement a method called add, that when given a string, it adds it to an internal list object. You can use the list object from the standard python library for the internal list. Next, implement a find method that takes a string as the argument. Implement the find method using sequential search. If the string is found return it, if not, return None. Create another class called BinaryStringList, that implements the same methods but uses a binary search as the implementation for find. Create a test program called sequential_test.py. Create an instance of your SequentialStringListand add 20 strings to it. Create a timeit test using one of the words in the list and the find method and another timeit test using a word not in the list and the find method. Create another test program called binary_test.py and perform the same tests.

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

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

=+j Understand different types of regions in the world.

Answered: 1 week ago