|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, size): |
|
|
def __init__(self, size): |
|
|
self.size = size |
|
|
self.size = size |
|
|
self.array = [AlgoDatValue(None)] * size |
|
|
|
|
|
|
|
|
self.array = [] |
|
|
|
|
|
for i in range(size): |
|
|
|
|
|
self.array.append(AlgoDatValue(None)) |
|
|
|
|
|
|
|
|
def set(self, index, value): |
|
|
def set(self, index, value): |
|
|
assert isinstance(value, AlgoDatValue) |
|
|
assert isinstance(value, AlgoDatValue) |
|
|
|
|
|
|
|
|
with open(filename, "r") as file: |
|
|
with open(filename, "r") as file: |
|
|
l = list(map(int, file.read().split())) |
|
|
l = list(map(int, file.read().split())) |
|
|
a = AlgoDatArray(len(l)) |
|
|
a = AlgoDatArray(len(l)) |
|
|
|
|
|
AlgoDatValue.memory -= len(l) |
|
|
for i in range(len(l)): |
|
|
for i in range(len(l)): |
|
|
a.set(i, AlgoDatValue(l[i])) |
|
|
a.set(i, AlgoDatValue(l[i])) |
|
|
return a |
|
|
return a |