blob: 6feb69e40cc33646b997777bab8312341ddf5479 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# Copyright (c) 2016 Egor Tensin <egor@tensin.name>
# This file is part of the "Sorting algorithms" project.
# For details, see https://github.com/egor-tensin/sorting-algorithms
# Distributed under the MIT License.
from . import input_kind
class Algorithm:
def __init__(self, codename, display_name, f):
self.codename = codename
self.display_name = display_name
self.function = f
@staticmethod
def gen_input(n, case=input_kind.InputKind.AVERAGE):
return input_kind.gen_input_for_sorting(n, case)
class SortingAlgorithm(Algorithm):
def gen_input(self, n, case=input_kind.InputKind.AVERAGE):
return input_kind.gen_input_for_sorting(n, case)
|