-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
21 lines (18 loc) · 830 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from Optimal_Partition_Search import optimal_partition_search
import random
import numpy as np
array = random.sample(range(150), 100)
print(f'array: {array}')
element = int(input("Enter the item you want to search\n"))
optimal_partition = optimal_partition_search(array, element)
print("Optimal no. of partitions", optimal_partition)
array = np.random.uniform(low=600.5, high=705.2, size=(10,))
print(f'array: {array}')
element = float(np.random.choice(array, 1))
optimal_partition = optimal_partition_search(array, element)
print("Optimal no. of partitions", optimal_partition)
array = ['a', 'c', 'q', 'l', 'h', 's', 'tr', 'input']
print(f'array: {array}')
element = input("Enter the item you want to search\n")
optimal_partition = optimal_partition_search(array, element)
print("Optimal no. of partitions", optimal_partition)