Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!