[問題] 程式碼問題

看板TransCSI作者 (☆★)時間16年前 (2009/04/05 21:47), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
Show that the following brute-force string matching algoritm takes average linear time to report all occurrences of a pattern string p in a text string t. 1:Let m = length of p;n=length of t; 2:for i = 1 to n-m+1 do 3: j=1; 4: while j<=m and p[j]=t[i+j-1] do 5: j=j+1; 6: if j>m then 7: Print i ; -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.127.38.23
文章代碼(AID): #19sBPWoE (TransCSI)
討論串 (同標題文章)
文章代碼(AID): #19sBPWoE (TransCSI)