[1,2] data-structures, maze #323

Merged
IvanBoy merged 7 commits from osininyai/2026-rff_mp:osininyai into develop 2026-05-30 11:28:50 +00:00
5 changed files with 21 additions and 25 deletions
Showing only changes of commit 6adc15ccd3 - Show all commits

View File

@ -37,7 +37,7 @@ def records():
second=0
phones2=phones.copy()
f=open("names.txt","r")
f=open("[1]names.txt","r")
count=0
names=[]
while count<5000:

View File

@ -196,7 +196,7 @@ def run_shuffled(records_shuffled):
["BinarySearchTree", u"случайный", u"вставка", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -217,7 +217,7 @@ def run_shuffled(records_shuffled):
["BinarySearchTree", u"случайный", u"поиск", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -247,7 +247,7 @@ def run_shuffled(records_shuffled):
["BinarySearchTree", u"случайный", u"удаление", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -321,7 +321,7 @@ def run_sorted(records_shuffled):
["BinarySearchTree", u"отсортированный", u"вставка", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -342,7 +342,7 @@ def run_sorted(records_shuffled):
["BinarySearchTree", u"отсортированный", u"поиск", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -372,7 +372,7 @@ def run_sorted(records_shuffled):
["BinarySearchTree", u"отсортированный", u"удаление", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")

View File

@ -1,5 +1,4 @@
from MP_records import records
import string
import random as rd
import time
import csv
@ -15,9 +14,6 @@ def polynomial_hash(word):
return hashh
def hash_to_index(hashh,length):
#print(hashh)
#if len(str(hashh))>4:
#hashh=int(str(hashh)[3:])
while hashh>length:
hashh=hashh%(length)
return hashh
@ -190,7 +186,7 @@ def test():
ht_insert(table, "h", 10)
print(table)
print(ht_find(table,"Aakk"))
# ht_delete(table, "Aakk")
#ht_delete(table, "Aakk")
#ht_delete(table, "Aaaaa")
#print(table)
#ht_delete(table, "Uaa")
@ -268,7 +264,7 @@ def run_shuffled(records_shuffled):
["HashTable", u"случайный", u"вставка", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -289,7 +285,7 @@ def run_shuffled(records_shuffled):
["HashTable", u"случайный", u"поиск", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -319,7 +315,7 @@ def run_shuffled(records_shuffled):
["HashTable", u"случайный", u"удаление", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -394,7 +390,7 @@ def run_sorted(records_shuffled):
["HashTable", u"отсортированный", u"вставка", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -415,7 +411,7 @@ def run_sorted(records_shuffled):
["HashTable", u"отсортированный", u"поиск", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -445,7 +441,7 @@ def run_sorted(records_shuffled):
["HashTable", u"отсортированный", u"удаление", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")

View File

@ -245,7 +245,7 @@ def run_shuffled(records_shuffled):
["LinkedList", u"случайный", u"вставка", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -266,7 +266,7 @@ def run_shuffled(records_shuffled):
["LinkedList", u"случайный", u"поиск", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -296,7 +296,7 @@ def run_shuffled(records_shuffled):
["LinkedList", u"случайный", u"удаление", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -372,7 +372,7 @@ def run_sorted(records_shuffled):
["LinkedList", u"отсортированный", u"вставка", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -393,7 +393,7 @@ def run_sorted(records_shuffled):
["LinkedList", u"отсортированный", u"поиск", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")
@ -423,7 +423,7 @@ def run_sorted(records_shuffled):
["LinkedList", u"отсортированный", u"удаление", temp,]
]
with codecs.open("results.csv", "a+", "utf-16") as f:
with codecs.open("docs/data/[1]results.csv", "a+", "utf-16") as f:
writer = csv.writer(f)
writer.writerows(results)
writer.writerows("\n")

View File

@ -21,7 +21,7 @@ while count<5000:
name+=consonants[letter]
names.append(name)
count+=1
f=open("names.txt","w")
f=open("[1]names.txt","w")
for i in names:
f.write(i)
f.write("\n")