class Algorithms:
def __init__(self, list) -> None:
self.list = list
def recursion_search(listn, start, end, index):
if (end < start):
print('wtf..')
return ValueError('End is less than 0')
else:
middle_value = start + ((end - start) // 2)
if listn[middle_value] < index: # The line that causes the problem
return Algorithms.recursion_search(listn, middle_value+1, end, index)
elif listn[middle_value] > index:
return Algorithms.recursion_search(listn, start, middle_value-1, index)
When I run the code above I get this error
TypeError: 'LinkedList' object is not subscriptable
I don't know what that means please help