def test():
    """Testing routine"""
    array = [1,5,3,2,4,6,0,7,8]
    i_element = 4
    # array = [2,0,1]
    print(rselect(array, i_element))
    import quicksort
    quicksort.sort_array(array)
    print(array[i_element])
def random_test(array_len):
    """Test on randomized array"""
    input_array = random.sample(range(array_len), array_len)
    i_element = array_len // 2
    print("algorithm result")
    print(rselect(input_array, i_element))
    import quicksort
    quicksort.sort_array(input_array)
    print('quicksort results')
    print(input_array[i_element])