Created
March 18, 2022 06:51
-
-
Save Eligijus112/6b6718dba0f0d2e0c84b070398cdd0cd to your computer and use it in GitHub Desktop.
Base class for sorting algorithms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BaseClass: | |
| def __init__( | |
| self, | |
| arr: list = [float] | |
| ): | |
| """ | |
| The base class for all the algorithms to inherit from | |
| """ | |
| # Ensuring the correct type | |
| if type(arr) != list: | |
| raise TypeError("Expected a list") | |
| # Saving the array to memory | |
| self.arr = arr | |
| # Saving the length of the array | |
| self.n = len(arr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment