Computer Science/자료구조

자료구조 | Sequential Search | Search

토마토. 2021. 12. 29. 22:10

순차 탐색

def sequential(lst, num):
    for i in range(len(lst)):
        if lst[i] == num:
            return i
    return -1