OmkarPathak/pygorithm

Abstract interface for classes

abramovd opened this issue · 1 comments

Hi!

As I see, all classes in data_structures module inherit from object, but have very similar interfaces.

What do you think about some refactoring to provide base abstract class to inherit from? It will be easier for new developers, because they will know for sure what methods should their classes implement. Additionally, similar refactoring can be done in other modules as well.

Could implement this as a PR, if you're ok with that.

Speaking about the disadvantages of such refactoring, a source code returned by get_code method may not be as clear as it is now, but on the other hand it will let users to focus only on the main parts of an implementation.

The overall idea is good. You can add a PR with an implementation of the single data structure. If that works out, we will further carry out with the same.