العربية  

books reduce problems

If you do not find what you're looking for, you can use more accurate words.

View more

تقليل المشاكل (Info)


المصفوفه C في الخوارزميه تنمو تربيعيا بالتناسب مع طول المتتاليات للمصفوفتين ذات ال 100 عنصر، مصفوفه 10.000 عنصر مطلوبه ومطلوب حدوث 10.000 مقارنه

function LCS(X[1..m], Y[1..n]) start := 1 m_end := m n_end := n trim off the matching items at the beginning while start ≤ m_end and start ≤ n_end and X[start] = Y[start] start := start + 1 trim off the matching items at the end while start ≤ m_end and start ≤ n_end and X[m_end] = Y[n_end] m_end := m_end - 1 n_end := n_end - 1 C = array(start-1..m_end, start-1..n_end) only loop over the items that have changed for i := start..m_end for j := start..n_end the algorithm continues as before ...

في أفضل سيناريو، وتسلسل بدون أي تغييرات، وهذا من شأنه ان يقضي تماما على الحاجة إلى المصفوفة C. في السيناريو الأسوأ، أي تغيير على البنود الأولى والأخيرة في تسلسل، لا يتم تنفيذ سوى اثنين من المقارنات إضافية.

Source: wikipedia.org