Skip to content

Instantly share code, notes, and snippets.

@Eligijus112
Created March 18, 2022 06:51
Show Gist options
  • Save Eligijus112/6b6718dba0f0d2e0c84b070398cdd0cd to your computer and use it in GitHub Desktop.
Save Eligijus112/6b6718dba0f0d2e0c84b070398cdd0cd to your computer and use it in GitHub Desktop.
Base class for sorting algorithms
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