demo LCS longest_common subsequence

버전 1.0.0 (37.3 KB) 작성자: shen vincent
problem : given two strings x and y, find the longest common subsequence (LCS) and print its length % Example: % x: abcic
다운로드 수: 0
업데이트 날짜: 2025/11/2

라이선스 보기

% code_m
% problem : given two strings x and y, find the longest common
% subsequence (LCS) and print its length
% Example:
% x: abcicba
% y: abdkscab
% "abca" is the longest subsequence found in both sequences, so the
% answer is 4
%{
How to slove this problem?
This demo is show how to find LCS using dynamic programming algorithem.
D(i,j):
if x(i -1) == y(i - 1)
D(i - 1, j - 1)
else
max(D(i - 1, j), D(i, j - 1))
Then do trace back
%}

인용 양식

shen vincent (2025). demo LCS longest_common subsequence (https://kr.mathworks.com/matlabcentral/fileexchange/182449-demo-lcs-longest_common-subsequence), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2025b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
태그 태그 추가

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0