레벤슈타인 거리 단계별 추적 소스코드: 편집 역사

IT 위키

차이 선택: 비교하려는 판의 라디오 버튼을 선택한 다음 엔터나 아래의 버튼을 누르세요.
설명: (최신) = 최신 판과 비교, (이전) = 이전 판과 비교, 잔글= 사소한 편집

    2025년 5월 8일 (목)

    • 최신이전 13:362025년 5월 8일 (목) 13:36AlanTuring 토론 기여 5,261 바이트 +5,261 새 문서: * 상위 문서: 레벤슈타인 거리 == 소스 코드 (python) == <syntaxhighlight lang="python3"> def print_matrix(matrix, X, Y): print(" " + " ".join(" " + c for c in Y)) for i, row in enumerate(matrix): prefix = " " if i == 0 else X[i - 1] print(prefix + " " + " ".join(f"{cell:2}" for cell in row)) print("\n") def edit_distance(X, Y): m, n = len(X), len(Y) dp = [[0] * (n + 1) for _ in range(m + 1)] # 초기화 for... 태그: 시각 편집